Skip to contentSkip to conversation

tcg: Remove unused tcg_out_dupi_vec() stub

PATCH In review Wataru Ashihara 3 participants 6 messages Jan 10, 2021 – Jan 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcg: Remove unused tcg_out_dupi_vec() stub

This fixes the build with --enable-tcg-interpreter:

clang -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -g -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -isystem /home/wsh/qc/qemu/linux-headers -isystem linux-headers -iquote /home/wsh/qc/qemu/tcg/tci -iquote . -iquote /home/wsh/qc/qemu -iquote /home/wsh/qc/qemu/accel/tcg -iquote /home/wsh/qc/qemu/include -iquote /home/wsh/qc/qemu/disas/libvixl -pthread -fPIC -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -MF libqemu-arm-softmmu.fa.p/tcg_tcg.c.o.d -o libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -c ../tcg/tcg.c ../tcg/tcg.c:136:20: error: unused function 'tcg_out_dupi_vec' [-Werror,-Wunused-function]

---
 tcg/tcg.c | 7 -------
 1 file changed, 7 deletions(-)
tcg/tcg.c +0 -7
index 472bf1755b..32df149b12 100644
@@ -117,8 +117,6 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
                             TCGReg dst, TCGReg src);
 static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
                              TCGReg dst, TCGReg base, intptr_t offset);
-static void tcg_out_dupi_vec(TCGContext *s, TCGType type,
-                             TCGReg dst, tcg_target_long arg);
 static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
                            unsigned vece, const TCGArg *args,
                            const int *const_args);
@@ -133,11 +131,6 @@ static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
 {
     g_assert_not_reached();
 }
-static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type,
-                                    TCGReg dst, tcg_target_long arg)
-{
-    g_assert_not_reached();
-}
 static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
                                   unsigned vece, const TCGArg *args,
                                   const int *const_args)
Signature · 1 line
2.25.1
#1 lore raw

Cc'ing Stefan.

Quoted 25 lines · Wataru Ashihara

This fixes the build with --enable-tcg-interpreter:

clang -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -g -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -isystem /home/wsh/qc/qemu/linux-headers -isystem linux-headers -iquote /home/wsh/qc/qemu/tcg/tci -iquote . -iquote /home/wsh/qc/qemu -iquote /home/wsh/qc/qemu/accel/tcg -iquote /home/wsh/qc/qemu/include -iquote /home/wsh/qc/qemu/disas/libvixl -pthread -fPIC -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -MF libqemu-arm-softmmu.fa.p/tcg_tcg.c.o.d -o libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -c ../tcg/tcg.c ../tcg/tcg.c:136:20: error: unused function 'tcg_out_dupi_vec' [-Werror,-Wunused-function]

---
 tcg/tcg.c | 7 -------
 1 file changed, 7 deletions(-)
tcg/tcg.c +0 -2
index 472bf1755b..32df149b12 100644
@@ -117,8 +117,6 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
                             TCGReg dst, TCGReg src);
 static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
                              TCGReg dst, TCGReg base, intptr_t offset);
-static void tcg_out_dupi_vec(TCGContext *s, TCGType type,
-                             TCGReg dst, tcg_target_long arg);
 static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
                            unsigned vece, const TCGArg *args,
                            const int *const_args);
@@ -133,11 +131,6 @@ static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
 {

tcg/tcg.c static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, · line 136

Quoted 10 lines
tcg/tcg.c +0 -5
     g_assert_not_reached();
 }
-static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type,
-                                    TCGReg dst, tcg_target_long arg)
-{
-    g_assert_not_reached();
-}
 static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
                                   unsigned vece, const TCGArg *args,
                                   const int *const_args)

AFAIK TCI does not support vectors, using them would trigger tcg_debug_assert(type == TCG_TYPE_I64) in tcg_out_movi().

As your approach might break other backends, I'm going to send an alternate patch using __attribute__((unused)).

Thanks for reporting this,

Phil.

#2 lore raw

Philippe, Richard, thank you for reviewing.

Quoted 42 lines · Philippe Mathieu-Daudé

Cc'ing Stefan.

Quoted 25 lines · Wataru Ashihara

This fixes the build with --enable-tcg-interpreter:

clang -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -g -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -isystem /home/wsh/qc/qemu/linux-headers -isystem linux-headers -iquote /home/wsh/qc/qemu/tcg/tci -iquote . -iquote /home/wsh/qc/qemu -iquote /home/wsh/qc/qemu/accel/tcg -iquote /home/wsh/qc/qemu/include -iquote /home/wsh/qc/qemu/disas/libvixl -pthread -fPIC -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -MF libqemu-arm-softmmu.fa.p/tcg_tcg.c.o.d -o libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -c ../tcg/tcg.c ../tcg/tcg.c:136:20: error: unused function 'tcg_out_dupi_vec' [-Werror,-Wunused-function]

---
 tcg/tcg.c | 7 -------
 1 file changed, 7 deletions(-)
tcg/tcg.c +0 -2
index 472bf1755b..32df149b12 100644
@@ -117,8 +117,6 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
                             TCGReg dst, TCGReg src);
 static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
                              TCGReg dst, TCGReg base, intptr_t offset);
-static void tcg_out_dupi_vec(TCGContext *s, TCGType type,
-                             TCGReg dst, tcg_target_long arg);
 static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
                            unsigned vece, const TCGArg *args,
                            const int *const_args);
@@ -133,11 +131,6 @@ static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
 {

tcg/tcg.c static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, · line 136

Quoted 10 lines
tcg/tcg.c +0 -5
     g_assert_not_reached();
 }
-static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type,
-                                    TCGReg dst, tcg_target_long arg)
-{
-    g_assert_not_reached();
-}
 static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
                                   unsigned vece, const TCGArg *args,
                                   const int *const_args)

AFAIK TCI does not support vectors, using them would trigger tcg_debug_assert(type == TCG_TYPE_I64) in tcg_out_movi().

Quoted 2 lines

As your approach might break other backends, I'm going to send an alternate patch using __attribute__((unused)).

Currently it doesn't. Unlike all the other tcg_out_*(), tcg_out_dupi_vec() is not used in tcg.c as discussed in [1].

Quoted 5 lines

Thanks for reporting this,

Phil.

I discard this patch in favor of the unconditionally-using way mentioned in [1].

Thanks.

[1]: https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg01647.html

#3 lore raw
In reply to Wataru Ashihara
Quoted 4 lines · Wataru Ashihara

This fixes the build with --enable-tcg-interpreter:

clang -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -g -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -isystem /home/wsh/qc/qemu/linux-headers -isystem linux-headers -iquote /home/wsh/qc/qemu/tcg/tci -iquote . -iquote /home/wsh/qc/qemu -iquote /home/wsh/qc/qemu/accel/tcg -iquote /home/wsh/qc/qemu/include -iquote /home/wsh/qc/qemu/disas/libvixl -pthread -fPIC -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -MF libqemu-arm-softmmu.fa.p/tcg_tcg.c.o.d -o libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -c ../tcg/tcg.c ../tcg/tcg.c:136:20: error: unused function 'tcg_out_dupi_vec' [-Werror,-Wunused-function]

What version of clang?
With clang 10, I can't even run configure without --disable-werror.

r~

#4 lore raw
Quoted 9 lines · Richard Henderson
Quoted 4 lines · Wataru Ashihara

This fixes the build with --enable-tcg-interpreter:

clang -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -g -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -isystem /home/wsh/qc/qemu/linux-headers -isystem linux-headers -iquote /home/wsh/qc/qemu/tcg/tci -iquote . -iquote /home/wsh/qc/qemu -iquote /home/wsh/qc/qemu/accel/tcg -iquote /home/wsh/qc/qemu/include -iquote /home/wsh/qc/qemu/disas/libvixl -pthread -fPIC -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -MF libqemu-arm-softmmu.fa.p/tcg_tcg.c.o.d -o libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -c ../tcg/tcg.c ../tcg/tcg.c:136:20: error: unused function 'tcg_out_dupi_vec' [-Werror,-Wunused-function]

What version of clang?
With clang 10, I can't even run configure without --disable-werror.

clang version 10.0.1 (Fedora 10.0.1-3.fc32)

I tested using:

../configure '--cc=clang' '--cxx=clang++' \
'--extra-cflags=-Wunused-function' '--enable-tcg-interpreter' \
'--disable-tools' '--target-list=arm-softmmu'

#5 lore raw
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Richard Henderson
Quoted 4 lines · Wataru Ashihara

This fixes the build with --enable-tcg-interpreter:

clang -Ilibqemu-arm-softmmu.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../dtc/libfdt -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -g -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -isystem /home/wsh/qc/qemu/linux-headers -isystem linux-headers -iquote /home/wsh/qc/qemu/tcg/tci -iquote . -iquote /home/wsh/qc/qemu -iquote /home/wsh/qc/qemu/accel/tcg -iquote /home/wsh/qc/qemu/include -iquote /home/wsh/qc/qemu/disas/libvixl -pthread -fPIC -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="arm-softmmu-config-target.h"' '-DCONFIG_DEVICES="arm-softmmu-config-devices.h"' -MD -MQ libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -MF libqemu-arm-softmmu.fa.p/tcg_tcg.c.o.d -o libqemu-arm-softmmu.fa.p/tcg_tcg.c.o -c ../tcg/tcg.c ../tcg/tcg.c:136:20: error: unused function 'tcg_out_dupi_vec' [-Werror,-Wunused-function]

What version of clang?
With clang 10, I can't even run configure without --disable-werror.

Quoted 8 lines

clang version 10.0.1 (Fedora 10.0.1-3.fc32)

I tested using:

../configure '--cc=clang' '--cxx=clang++' \
'--extra-cflags=-Wunused-function' '--enable-tcg-interpreter' \
'--disable-tools' '--target-list=arm-softmmu'

  $ clang --version
  clang version 10.0.0-4ubuntu1
  Target: x86_64-pc-linux-gnu
  Thread model: posix
  InstalledDir: /usr/bin

And I configured with:

  ../configure --prefix=$HOME/opt/qemu-tci --cc=clang --host-cc=clang --cxx=clang++ --enable-debug --enable-tcg-interpreter --enable-debug-tcg --enable-debug-info --enable-debug-mutex