clean build - eliminate warnings
cover clean build - eliminate warnings
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1)
softmmu 0 (-39)
x86 0 (0)
arm 0 (-10)
cris 0 (-7)
m68k 0 (-4)
mips 0 (0)
ppc 0 (0)
sh4 0 (-18)
sparc 0 (0) linux-user 42 (-12)
x86 0 (0)
arm 42 (-8)
cris 0 (-2)
m68k 0 (-2)
mips 0 (0)
ppc 0 (0)
sh4 0 (0)
sparc 0 (0)
alpha 0 (0)
So please apply (unless I papered over some real bug) and also take care to avoid new ones in the future! (Be warned: I've a script here to generate that overview, and I won't hesitate posting "regressions" when required ;) ).
Find the patches also at git://git.kiszka.org/qemu.git queues/warnings
Jan Kiszka (7):
clean build: Add bt_host_hci prototype
clean build: Fix irq_info and pic_info related warnings
arm: Fix gic_irq_state.level bitfield type clean build: Fix arm build warnings
clean build: Fix remaining cris warnings clean build: Fix remaining m68k warnings clean build: Fix remaining sh4 warnings
arm-dis.c | 45 --------------------------------------------- bt-host.c | 2 ++ hw/an5206.c | 1 + hw/arm_boot.c | 2 +- hw/arm_gic.c | 2 +- hw/arm_pic.c | 1 + hw/etraxfs_eth.c | 3 +-- hw/etraxfs_pic.c | 1 + hw/etraxfs_ser.c | 1 + hw/etraxfs_timer.c | 1 + hw/omap_clk.c | 17 ----------------- hw/shix.c | 16 +--------------- target-arm/helper.c | 2 +- target-cris/cpu.h | 3 +++ target-cris/exec.h | 3 --- target-cris/translate.c | 2 +- target-m68k/cpu.h | 3 +++ target-m68k/exec.h | 3 --- target-m68k/helper.c | 5 ----- target-sh4/cpu.h | 2 ++ target-sh4/exec.h | 6 ------ target-sh4/helper.c | 14 +++++++------- 22 files changed, 28 insertions(+), 107 deletions(-)
PATCH 1/7 clean build: Add bt_host_hci prototype
Silence compiler warning by providing a prototype in the CONFIG_BLUEZ case (hw/bt.h provides it otherwise).
---
bt-host.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
bt-host.c +2 -0
@@ -31,6 +31,8 @@# include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci (const char *id);# else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028
[Qemu-devel] Re: [PATCH 1/7] clean build: Add bt_host_hci prototype
Quoted 14 lines · Jan Kiszka
Silence compiler warning by providing a prototype in the
CONFIG_BLUEZcase (hw/bt.hprovides it otherwise).Signed-off-by Jan Kiszka <[email protected]>---
bt-host.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)bt-host.c +0
-0
bt-host.c line 38
Quoted 8 lines
bt-host.c +2
-0@@ -31,6 +31,8 @@# include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci (const char *id);# else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028
Thanks for applying the other patches, but this tiny one always seems to be ignored - for unknown reasons. :)
Jan
[Qemu-devel] Re: [PATCH 1/7] clean build: Add bt_host_hci prototype
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Jan Kiszka
Silence compiler warning by providing a prototype in the
CONFIG_BLUEZcase (hw/bt.hprovides it otherwise).Signed-off-by Jan Kiszka <[email protected]>---
bt-host.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Quoted 17 lines
bt-host.c line 38
Quoted 13 lines
bt-host.c +2
-0@@ -31,6 +31,8 @@# include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci (const char *id);# else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028Thanks for applying the other patches, but this tiny one always seems to be ignored - for unknown reasons. :)
On my side, I consider that a hack, not a fix. We should make sure the correct header is included so that this function is declared.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
PATCH 1/1 clean build: Add bt-host.h
Quoted 28 lines · Aurelien Jarno
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Jan Kiszka
Silence compiler warning by providing a prototype in the
CONFIG_BLUEZcase (hw/bt.hprovides it otherwise).Signed-off-by Jan Kiszka <[email protected]>---
bt-host.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)Quoted 16 lines
bt-host.c line 38
Quoted 13 lines
bt-host.c +2
-0@@ -31,6 +31,8 @@# include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci (const char *id);# else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028Thanks for applying the other patches, but this tiny one always seems to be ignored - for unknown reasons. :)
Quoted 3 lines
On my side, I consider that a hack, not a fix. We should make sure the correct header is included so that this function is declared.
As always: no comment means no progress. This one better?
-------->
Silence compiler warning by providing proper CONFIG_BLUEZ-independent header for the bt-host API.
---
bt-host.c | 1 + bt-host.h | 9 +++++++++ hw/bt.h | 3 --- vl.c | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 bt-host.h
bt-host.c +1 -0
@@ -22,6 +22,7 @@#include "qemu-char.h" #include "sysemu.h" #include "net.h" +#include "bt-host.h" #ifndef _WIN32# include <errno.h>
bt-host.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef BT_HOST_H +#define BT_HOST_H + +struct HCIInfo ; + +/* bt-host.c */ +struct HCIInfo *bt_host_hci (const char *id); + +#endif
hw/bt.h +0 -3
@@ -112,9 +112,6 @@ void bt_device_done(struct bt_device_s *dev);/* bt-hci.c */ struct HCIInfo *bt_new_hci (struct bt_scatternet_s *net); -/* bt-host.c */ -struct HCIInfo *bt_host_hci (const char *id); -/* bt-vhci.c */ void bt_vhci_init (struct HCIInfo *info);
vl.c +1 -0
@@ -137,6 +137,7 @@ int main(int argc, char **argv)#include "hw/isa.h" #include "hw/baum.h" #include "hw/bt.h" +#include "bt-host.h" #include "net.h" #include "monitor.h" #include "console.h"
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH] clean build: Add bt-host.h
Quoted 33 lines · Jan Kiszka
Quoted 28 lines · Aurelien Jarno
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Jan Kiszka
Silence compiler warning by providing a prototype in the
CONFIG_BLUEZcase (hw/bt.hprovides it otherwise).Signed-off-by Jan Kiszka <[email protected]>---
bt-host.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)Quoted 16 lines
bt-host.c line 38
Quoted 13 lines
bt-host.c +2
-0@@ -31,6 +31,8 @@# include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci (const char *id);# else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028Thanks for applying the other patches, but this tiny one always seems to be ignored - for unknown reasons. :)
Quoted 3 lines
On my side, I consider that a hack, not a fix. We should make sure the correct header is included so that this function is declared.
Quoted 8 lines
As always: no comment means no progress. This one better?
-------->
Silence compiler warning by providing proper CONFIG_BLUEZ-independent header for the bt-host API.
Signed-off-by Jan Kiszka <[email protected]>
Thanks, applied.
Quoted 64 lines
bt-host.c | 1 + bt-host.h | 9 +++++++++ hw/bt.h | 3 --- vl.c | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 bt-host.hbt-host.c +1
-0@@ -22,6 +22,7 @@#include "qemu-char.h" #include "sysemu.h" #include "net.h" +#include "bt-host.h" #ifndef _WIN32# include <errno.h> bt-host.h new file +9
-0@@ -0,0 +1,9 @@ +#ifndef BT_HOST_H +#define BT_HOST_H + +struct HCIInfo ; + +/* bt-host.c */ +struct HCIInfo *bt_host_hci (const char *id); + +#endif hw/bt.h +0
-3@@ -112,9 +112,6 @@ void bt_device_done(struct bt_device_s *dev);/* bt-hci.c */ struct HCIInfo *bt_new_hci (struct bt_scatternet_s *net); -/* bt-host.c */ -struct HCIInfo *bt_host_hci (const char *id); -/* bt-vhci.c */ void bt_vhci_init (struct HCIInfo *info);vl.c +1
-0@@ -137,6 +137,7 @@ int main(int argc, char **argv)#include "hw/isa.h" #include "hw/baum.h" #include "hw/bt.h" +#include "bt-host.h" #include "net.h" #include "monitor.h" #include "console.h"
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
Re: [Qemu-devel] [PATCH] clean build: Add bt-host.h
In reply to Jan Kiszka2009/3/8 Jan Kiszka <[email protected]>:
Quoted 29 lines
Quoted 28 lines · Aurelien Jarno
Quoted 26 lines · Jan Kiszka
Quoted 14 lines · Jan Kiszka
Silence compiler warning by providing a prototype in the
CONFIG_BLUEZcase (hw/bt.hprovides it otherwise).Signed-off-by Jan Kiszka <[email protected]>---
bt-host.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)bt-host.c +0
-0bt-host.c line 38
Quoted 8 lines
bt-host.c +2
-0@@ -31,6 +31,8 @@ # include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci(const char *id); # else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028Thanks for applying the other patches, but this tiny one always seems to be ignored - for unknown reasons. :)
Quoted 5 lines
Quoted 3 lines
On my side, I consider that a hack, not a fix. We should make sure the correct header is included so that this function is declared.
As always: no comment means no progress. This one better?
Is it?
struct HCIInfo is defined in net.h so maybe this one belongs there too.
I'd much rather turn off the unhelpful warnings, some of them caused developers to add code that is both more hacky and slower. I also think we could save many header files like the hw/virtio-*.h, at this granularity they don't help with compile times which was the reason vl.h was split.
Regards
[Qemu-devel] Re: [PATCH] clean build: Add bt-host.h
Quoted 34 lines · andrzej zaborowski
2009/3/8 Jan Kiszka <[email protected]>:
Quoted 28 lines
Quoted 27 lines · Aurelien Jarno
Quoted 26 lines · Jan Kiszka
Quoted 14 lines · Jan Kiszka
Silence compiler warning by providing a prototype in the
CONFIG_BLUEZcase (hw/bt.hprovides it otherwise).Signed-off-by Jan Kiszka <[email protected]>---
bt-host.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)bt-host.c +0
-0bt-host.c line 38
Quoted 8 lines
bt-host.c +2
-0@@ -31,6 +31,8 @@# include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/hci_lib.h> +/* Silence compiler warning */ +struct HCIInfo *bt_host_hci (const char *id);# else # include "hw/bt.h" # define HCI_MAX_FRAME_SIZE 1028Thanks for applying the other patches, but this tiny one always seems to be ignored - for unknown reasons. :)
Quoted 4 lines
Quoted 3 lines
On my side, I consider that a hack, not a fix. We should make sure the correct header is included so that this function is declared.
As always: no comment means no progress. This one better?
Quoted 8 lines
Is it?
struct HCIInfo is defined innet.hso maybe this one belongs there too.I'd much rather turn off the unhelpful warnings, some of them caused developers to add code that is both more hacky and slower. I also think we could save many header files like the
hw/virtio-*.h, at this granularity they don't help with compile times which was the reasonvl.hwas split.
I think we see so far a net gain from the warnings as several real bugs were caught that way. And in this case the warning pointed out unclean header organization (internal API exports mixed up with generic bluetooth types). The goal should not be "as few headers as possible" but "one header per reasonably partitioned API". IMHO, virtio is cleanly organized (and is surely no relevant contributor to compile times).
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux
Re: [Qemu-devel] Re: [PATCH] clean build: Add bt-host.h
2009/3/11 Jan Kiszka <[email protected]>:
Quoted 1 line
andrzej zaborowski wrote:
,,,
Quoted 11 lines
Quoted 8 lines
Is it?
struct HCIInfo is defined innet.hso maybe this one belongs there too.I'd much rather turn off the unhelpful warnings, some of them caused developers to add code that is both more hacky and slower. I also think we could save many header files like the
hw/virtio-*.h, at this granularity they don't help with compile times which was the reasonvl.hwas split.I think we see so far a net gain from the warnings as several real bugs were caught that way.
Some of the warnings are useful and some are just "if leave your house a brick might fall on your head and you might die" type.
Quoted 4 lines
And in this case the warning pointed out unclean
header organization (internal API exports mixed up with generic bluetooth types). The goal should not be "as few headers as possible" but "one header per reasonably partitioned API".
Right, this makes browsing the headers much easier when looking up a prototype. This change is in the opposite direction.
(and why is it less hacky?)
Cheers
PATCH 2/7 clean build: Fix irq_info and pic_info related warnings
In reply to Jan KiszkaEnsure that all providers of irq_info and pic_info include pc.h to avoid compiler warnings.
---
hw/an5206.c | 1 + hw/arm_pic.c | 1 + hw/etraxfs_pic.c | 1 + hw/shix.c | 1 + 4 files changed, 4 insertions(+), 0 deletions(-)
hw/an5206.c +1 -0
@@ -7,6 +7,7 @@*/ #include "hw.h" +#include "pc.h" #include "mcf.h" #include "sysemu.h" #include "boards.h"
hw/arm_pic.c +1 -0
@@ -8,6 +8,7 @@*/ #include "hw.h" +#include "pc.h" #include "arm-misc.h" /* Stub functions for hardware that doesn't exist. */
hw/etraxfs_pic.c +1 -0
@@ -24,6 +24,7 @@#include <stdio.h> #include "hw.h" +#include "pc.h" #include "etraxfs.h" #define D (x)
hw/shix.c +1 -0
@@ -28,6 +28,7 @@More information in target-sh4/README.sh4 */ #include "hw.h" +#include "pc.h" #include "sh.h" #include "sysemu.h" #include "boards.h"
PATCH 3/7 arm: Fix gic_irq_state.level bitfield type
In reply to Jan KiszkaFound while cleaning up compiler warnings: GIC_*_LEVEL macros strongly suggest that gic_irq_state.level is intended to be per-CPU and not just a single, global bit. I'm unable to test the effect, but it seems to be the most reasonable fix for the apparent brokenness.
---
hw/arm_gic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/arm_gic.c +1 -1
@@ -39,7 +39,7 @@ typedef struct gic_irq_state unsigned enabled:1; unsigned pending:NCPU; unsigned active:NCPU; - unsigned level:1; + unsigned level:NCPU; unsigned model:1; /* 0 = N:N, 1 = 1:N */ unsigned trigger:1; /* nonzero = edge triggered. */ } gic_irq_state;
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH 3/7] arm: Fix gic_irq_state.level bitfield type
Quoted 6 lines · Jan Kiszka
Found while cleaning up compiler warnings: GIC_*_LEVEL macros strongly suggest that gic_irq_state.level is intended to be per-CPU and not just a single, global bit. I'm unable to test the effect, but it seems to be the most reasonable fix for the apparent brokenness.
Signed-off-by Jan Kiszka <[email protected]>
Thanks applied.
Quoted 22 lines
---
hw/arm_gic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/arm_gic.c +1
-1@@ -39,7 +39,7 @@ typedef struct gic_irq_state unsigned enabled:1; unsigned pending:NCPU; unsigned active:NCPU; - unsigned level:1; + unsigned level:NCPU; unsigned model:1; /* 0 = N:N, 1 = 1:N */ unsigned trigger:1; /* nonzero = edge triggered. */ } gic_irq_state;
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
PATCH 4/7 clean build: Fix arm build warnings
In reply to Jan KiszkaFix remaining arm warnings - except for the mess in the NetWinder FP emulator.
---
arm-dis.c | 45 --------------------------------------------- hw/arm_boot.c | 2 +- hw/omap_clk.c | 17 ----------------- target-arm/helper.c | 2 +- 4 files changed, 2 insertions(+), 64 deletions(-)
arm-dis.c +0 -26
@@ -1554,32 +1554,6 @@ enum map_type last_type;int last_mapping_sym =-1 ;bfd_vma last_mapping_addr =0 ; - -/* Functions. */ -int -get_arm_regname_num_options (void ) -{ -return NUM_ARM_REGNAMES ; -} - -int -set_arm_regname_option (int option) -{ -int old = regname_selected; - regname_selected = option; -return old; -} - -int -get_arm_regnames (int option,const char **setname,const char **setdescription, -const char *const **register_names) -{ - *setname = regnames[option].name; - *setdescription = regnames[option].description; - *register_names = regnames[option].reg_names; -return 16 ; -} -/* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?. Returns pointer to following character of the format string and
fills in *VALUEP and *WIDTHP with the extracted value and number of
@@ -4144,22 +4118,3 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
}
return size;
}
-
-void
-print_arm_disassembler_options (FILE *stream)
-{
- int i;
-
- fprintf (stream, _("\n\
-The following ARM specific disassembler options are supported for use with\n\
-the -M switch:\n"));
-
- for (i = NUM_ARM_REGNAMES; i--;)
- fprintf (stream, " reg-names-%s %*c%s\n",
- regnames[i].name, - (int)(14 - strlen (regnames[i].name)), ' ', - regnames[i].description); - - fprintf (stream, " force-thumb Assume all insns are Thumb insns\n"); - fprintf (stream, " no-force-thumb Examine preceeding label to determine an insn's type\n\n");
-}
hw/arm_boot.c +1 -1
@@ -107,7 +107,7 @@ static void set_kernel_args_old(struct arm_boot_info *info, int initrd_size, void *base) { uint32_t *p; -unsigned char *s; +char *s;/* see linux/include/asm-arm/setup.h */ p = (uint32_t *)(base +KERNEL_ARGS_ADDR );
hw/omap_clk.c +0 -17
@@ -1098,23 +1098,6 @@ void omap_clk_adduser(struct clk *clk, qemu_irq user) *i = user; } -/* If a clock is allowed to idle, it is disabled automatically when -* all of clock domains using it are disabled. */ -static int omap_clk_is_idle (struct clk *clk) -{ -struct clk *chld; - -if (!clk->enabled && (!clk->usecount || !(clk->flags &&ALWAYS_ENABLED ))) -return 1 ; -if (clk->usecount) -return 0 ; - -for (chld = clk->child1; chld; chld = chld->sibling) -if (!omap_clk_is_idle (chld)) -return 0 ; -return 1 ; -} -struct clk *omap_findclk (struct omap_mpu_state_s *mpu,const char *name) {struct clk *i;
target-arm/helper.c +1 -1
@@ -690,7 +690,7 @@ static void do_v7m_exception_exit(CPUARMState *env)pointer. */ } -void do_interrupt_v7m (CPUARMState *env) +static void do_interrupt_v7m (CPUARMState *env) {uint32_t xpsr =xpsr_read (env);uint32_t lr;
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH 4/7] clean build: Fix arm build warnings
Quoted 4 lines · Jan Kiszka
Fix remaining arm warnings - except for the mess in the NetWinder FP emulator.
Signed-off-by Jan Kiszka <[email protected]>
Thanks, applied.
Quoted 127 lines
---
arm-dis.c | 45 --------------------------------------------- hw/arm_boot.c | 2 +- hw/omap_clk.c | 17 ----------------- target-arm/helper.c | 2 +- 4 files changed, 2 insertions(+), 64 deletions(-)arm-dis.c +0
-26@@ -1554,32 +1554,6 @@ enum map_type last_type;int last_mapping_sym =-1 ;bfd_vma last_mapping_addr =0 ; - -/* Functions. */ -int -get_arm_regname_num_options (void ) -{ -return NUM_ARM_REGNAMES ; -} - -int -set_arm_regname_option (int option) -{ -int old = regname_selected; - regname_selected = option; -return old; -} - -int -get_arm_regnames (int option,const char **setname,const char **setdescription, -const char *const **register_names) -{ - *setname = regnames[option].name; - *setdescription = regnames[option].description; - *register_names = regnames[option].reg_names; -return 16 ; -} -/* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?. Returns pointer to following character of the format string and fills in *VALUEP and *WIDTHP with the extracted value and number of
arm-dis.c +0
-19@@ -4144,22 +4118,3 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info) }return size; } - -void -print_arm_disassembler_options (FILE *stream) -{ -int i; - -fprintf (stream,_ ("\n\ -The following ARM specific disassembler options are supported for use with\n\ -the -M switch:\n" )); - -for (i =NUM_ARM_REGNAMES ; i--;) -fprintf (stream," reg-names-%s %*c%s\n" , - regnames[i].name, - (int )(14 -strlen (regnames[i].name)),' ' , - regnames[i].description); - -fprintf (stream," force-thumb Assume all insns are Thumb insns\n" ); -fprintf (stream," no-force-thumb Examine preceeding label to determine an insn's type\n\n" ); -}hw/arm_boot.c +1
-1@@ -107,7 +107,7 @@ static void set_kernel_args_old(struct arm_boot_info *info, int initrd_size, void *base) { uint32_t *p; -unsigned char *s; +char *s;/* see linux/include/asm-arm/setup.h */ p = (uint32_t *)(base +KERNEL_ARGS_ADDR );hw/omap_clk.c +0
-17@@ -1098,23 +1098,6 @@ void omap_clk_adduser(struct clk *clk, qemu_irq user) *i = user; } -/* If a clock is allowed to idle, it is disabled automatically when -* all of clock domains using it are disabled. */ -static int omap_clk_is_idle (struct clk *clk) -{ -struct clk *chld; - -if (!clk->enabled && (!clk->usecount || !(clk->flags &&ALWAYS_ENABLED ))) -return 1 ; -if (clk->usecount) -return 0 ; - -for (chld = clk->child1; chld; chld = chld->sibling) -if (!omap_clk_is_idle (chld)) -return 0 ; -return 1 ; -} -struct clk *omap_findclk (struct omap_mpu_state_s *mpu,const char *name) {struct clk *i;target-arm/helper.c +1
-1@@ -690,7 +690,7 @@ static void do_v7m_exception_exit(CPUARMState *env)pointer. */ } -void do_interrupt_v7m (CPUARMState *env) +static void do_interrupt_v7m (CPUARMState *env) {uint32_t xpsr =xpsr_read (env);uint32_t lr;
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
PATCH 5/7 clean build: Fix remaining cris warnings
In reply to Jan Kiszka---
hw/etraxfs_eth.c | 3 +-- hw/etraxfs_ser.c | 1 + hw/etraxfs_timer.c | 1 + target-cris/cpu.h | 3 +++ target-cris/exec.h | 3 --- target-cris/translate.c | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-)
hw/etraxfs_eth.c +1 -2
@@ -25,8 +25,7 @@#include <stdio.h> #include "hw.h" #include "net.h" - -#include "etraxfs_dma.h" +#include "etraxfs.h" #define D (x)
hw/etraxfs_ser.c +1 -0
@@ -26,6 +26,7 @@#include <ctype.h> #include "hw.h" #include "qemu-char.h" +#include "etraxfs.h" #define D (x)
hw/etraxfs_timer.c +1 -0
@@ -26,6 +26,7 @@#include "hw.h" #include "sysemu.h" #include "qemu-timer.h" +#include "etraxfs.h" #define D (x)
target-cris/cpu.h +3 -0
@@ -216,6 +216,9 @@ static inline int cpu_mmu_index (CPUState *env)return !!(env->pregs[PR_CCS ] &U_FLAG ); } +int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int mmu_idx,int is_softmmu); +#if defined(CONFIG_USER_ONLY )static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) {
target-cris/exec.h +0 -3
@@ -33,9 +33,6 @@ static inline void regs_to_env(void) { } -int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, -int mmu_idx,int is_softmmu); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif
target-cris/translate.c +1 -1
@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32; +TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;
Re: [Qemu-devel] [PATCH 5/7] clean build: Fix remaining cris warnings
target-cris/translate.c static unsigned int dec_move_pm(DisasContext *dc) · line 2619
Quoted 13 lines · Jan Kiszka
target-cris/translate.c +1
-1@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32; +TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;
Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful. At the very least, shouldn't there be a comment? Something like Linux's uninitialized_var() macro might be worth considering...
Signature · 1 line
Stuart Brady
Re: [Qemu-devel] [PATCH 5/7] clean build: Fix remaining cris warnings
Quoted 16 lines · Stuart Brady
target-cris/translate.c static unsigned int dec_move_pm(DisasContext *dc) · line 2619
Quoted 13 lines · Jan Kiszka
target-cris/translate.c +1
-1@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32; +TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful.
Also, with 'tmp32 = 0', the build breaks with DEBUG_TCGV defined...
Quoted 2 lines
At the very least, shouldn't there be a comment? Something like Linux's
uninitialized_var()macro might be worth considering...
Signature · 1 line
Stuart Brady
Re: [Qemu-devel] [PATCH 5/7] clean build: Fix remaining cris warnings
In reply to Stuart BradyQuoted 10 lines · Stuart Brady
Quoted 9 lines · Jan Kiszka
target-cris/translate.c +0
-1@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32;
Quoted 8 lines
target-cris/translate.c static unsigned int dec_move_pm(DisasContext *dc) · line 2619
Quoted 4 lines
target-cris/translate.c +1
-0+TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful. At the very least, shouldn't there be a comment? Something like Linux's
uninitialized_var()macro might be worth considering...
Some targets use TCGV_UNUSED_I32/I64. I would initialize tmp32 to that value in an additional else part to the first if (nr & 1). That should silence gcc.
Laurent
PATCH v2 5/7 clean build: Fix remaining cris warnings
Quoted 19 lines · Laurent Desnogues
Quoted 17 lines · Stuart Brady
target-cris/translate.c static unsigned int dec_move_pm(DisasContext *dc) · line 2619
Quoted 13 lines · Jan Kiszka
target-cris/translate.c +1
-1@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32; +TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful. At the very least, shouldn't there be a comment? Something like Linux's
uninitialized_var()macro might be worth considering...
Quoted 4 lines
Some targets use TCGV_UNUSED_I32/I64. I would initialize tmp32 to that value in an additional else part to the first if (nr & 1). That should silence gcc.
Good point, here is a fixed version according to your suggestion:
------------->
---
hw/etraxfs_eth.c | 3 +-- hw/etraxfs_ser.c | 1 + hw/etraxfs_timer.c | 1 + target-cris/cpu.h | 3 +++ target-cris/exec.h | 3 --- target-cris/translate.c | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-)
hw/etraxfs_eth.c +1 -2
@@ -25,8 +25,7 @@#include <stdio.h> #include "hw.h" #include "net.h" - -#include "etraxfs_dma.h" +#include "etraxfs.h" #define D (x)
hw/etraxfs_ser.c +1 -0
@@ -26,6 +26,7 @@#include <ctype.h> #include "hw.h" #include "qemu-char.h" +#include "etraxfs.h" #define D (x)
hw/etraxfs_timer.c +1 -0
@@ -26,6 +26,7 @@#include "hw.h" #include "sysemu.h" #include "qemu-timer.h" +#include "etraxfs.h" #define D (x)
target-cris/cpu.h +3 -0
@@ -216,6 +216,9 @@ static inline int cpu_mmu_index (CPUState *env)return !!(env->pregs[PR_CCS ] &U_FLAG ); } +int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int mmu_idx,int is_softmmu); +#if defined(CONFIG_USER_ONLY )static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) {
target-cris/exec.h +0 -3
@@ -33,9 +33,6 @@ static inline void regs_to_env(void) { } -int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, -int mmu_idx,int is_softmmu); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif
target-cris/translate.c +2 -1
@@ -2633,7 +2633,8 @@ static unsigned int dec_movem_mr(DisasContext *dc) tmp32 =tcg_temp_new_i32 ();tcg_gen_addi_tl (addr, cpu_R[dc->op1], i *8 );gen_load (dc, tmp32, addr,4 ,0 ); - } + }else +TCGV_UNUSED (tmp32);tcg_temp_free (addr);for (i =0 ; i < (nr >>1 ); i++) {
Edgar E. Iglesias
AppliedRe: [Qemu-devel] [PATCH v2 5/7] clean build: Fix remaining cris warnings
Quoted 20 lines · Jan Kiszka
Quoted 19 lines · Laurent Desnogues
Quoted 17 lines · Stuart Brady
target-cris/translate.c static unsigned int dec_move_pm(DisasContext *dc) · line 2619
Quoted 13 lines · Jan Kiszka
target-cris/translate.c +1
-1@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32; +TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful. At the very least, shouldn't there be a comment? Something like Linux's
uninitialized_var()macro might be worth considering...
Quoted 8 lines
Quoted 4 lines
Some targets use TCGV_UNUSED_I32/I64. I would initialize tmp32 to that value in an additional else part to the first if (nr & 1). That should silence gcc.
Good point, here is a fixed version according to your suggestion:
------------->
Applied, thanks everybody.
Quoted 93 lines
Signed-off-by Jan Kiszka <[email protected]>---
hw/etraxfs_eth.c | 3 +-- hw/etraxfs_ser.c | 1 + hw/etraxfs_timer.c | 1 + target-cris/cpu.h | 3 +++ target-cris/exec.h | 3 --- target-cris/translate.c | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-)hw/etraxfs_eth.c +1
-2@@ -25,8 +25,7 @@#include <stdio.h> #include "hw.h" #include "net.h" - -#include "etraxfs_dma.h" +#include "etraxfs.h" #define D (x)hw/etraxfs_ser.c +1
-0@@ -26,6 +26,7 @@#include <ctype.h> #include "hw.h" #include "qemu-char.h" +#include "etraxfs.h" #define D (x)hw/etraxfs_timer.c +1
-0@@ -26,6 +26,7 @@#include "hw.h" #include "sysemu.h" #include "qemu-timer.h" +#include "etraxfs.h" #define D (x)target-cris/cpu.h +3
-0@@ -216,6 +216,9 @@ static inline int cpu_mmu_index (CPUState *env)return !!(env->pregs[PR_CCS ] &U_FLAG ); } +int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int mmu_idx,int is_softmmu); +#if defined(CONFIG_USER_ONLY )static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) {target-cris/exec.h +0
-3@@ -33,9 +33,6 @@ static inline void regs_to_env(void) { } -int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, -int mmu_idx,int is_softmmu); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif target-cris/translate.c +2
-1@@ -2633,7 +2633,8 @@ static unsigned int dec_movem_mr(DisasContext *dc) tmp32 =tcg_temp_new_i32 ();tcg_gen_addi_tl (addr, cpu_R[dc->op1], i *8 );gen_load (dc, tmp32, addr,4 ,0 ); - } + }else +TCGV_UNUSED (tmp32);tcg_temp_free (addr);for (i =0 ; i < (nr >>1 ); i++) {
Re: [Qemu-devel] [PATCH 5/7] clean build: Fix remaining cris warnings
In reply to Stuart BradyQuoted 16 lines · Stuart Brady
target-cris/translate.c static unsigned int dec_move_pm(DisasContext *dc) · line 2619
Quoted 13 lines · Jan Kiszka
target-cris/translate.c +1
-1@@ -2613,7 +2613,7 @@ static unsigned int dec_move_pm(DisasContext *dc)static unsigned int dec_movem_mr (DisasContext *dc) {TCGv_i64 tmp[16 ]; -TCGv tmp32; +TCGv tmp32 =0 ;TCGv addr;int i;int nr = dc->op2 +1 ;Hmm, GCC just gets it wrong here -- and 0 isn't really very meaningful.
Worse than that, 0 is actively wrong. You obviously haven't built with DEBUG_TCGV.
Quoted 2 lines
At the very least, shouldn't there be a comment? Something like Linux's
uninitialized_var()macro might be worth considering...
There already is. TCGV_UNUSED.
Paul
PATCH 6/7 clean build: Fix remaining m68k warnings
In reply to Jan Kiszka---
target-m68k/cpu.h | 3 +++ target-m68k/exec.h | 3 --- target-m68k/helper.c | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-)
target-m68k/cpu.h +3 -0
@@ -222,6 +222,9 @@ static inline int cpu_mmu_index (CPUState *env)return (env->sr &SR_S ) ==0 ?1 :0 ; } +int cpu_m68k_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int mmu_idx,int is_softmmu); +#if defined(CONFIG_USER_ONLY )static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) {
target-m68k/exec.h +0 -3
@@ -37,9 +37,6 @@ static inline void regs_to_env(void) { } -int cpu_m68k_handle_mmu_fault (CPUState *env,target_ulong address,int rw, -int mmu_idx,int is_softmmu); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif
target-m68k/helper.c +0 -5
@@ -454,11 +454,6 @@ uint32_t HELPER(xflag_lt)(uint32_t a, uint32_t b)return a < b; } -uint32_t HELPER (btest )(uint32_t x) -{ -return x !=0 ; -} -void HELPER (set_sr )(CPUState *env,uint32_t val) { env->sr = val &0xffff ;
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH 6/7] clean build: Fix remaining m68k warnings
Quoted 2 lines · Jan Kiszka
Signed-off-by Jan Kiszka <[email protected]>---
Thanks, applied.
Quoted 54 lines
target-m68k/cpu.h | 3 +++ target-m68k/exec.h | 3 --- target-m68k/helper.c | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-)target-m68k/cpu.h +3
-0@@ -222,6 +222,9 @@ static inline int cpu_mmu_index (CPUState *env)return (env->sr &SR_S ) ==0 ?1 :0 ; } +int cpu_m68k_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int mmu_idx,int is_softmmu); +#if defined(CONFIG_USER_ONLY )static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) {target-m68k/exec.h +0
-3@@ -37,9 +37,6 @@ static inline void regs_to_env(void) { } -int cpu_m68k_handle_mmu_fault (CPUState *env,target_ulong address,int rw, -int mmu_idx,int is_softmmu); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif target-m68k/helper.c +0
-5@@ -454,11 +454,6 @@ uint32_t HELPER(xflag_lt)(uint32_t a, uint32_t b)return a < b; } -uint32_t HELPER (btest )(uint32_t x) -{ -return x !=0 ; -} -void HELPER (set_sr )(CPUState *env,uint32_t val) { env->sr = val &0xffff ;
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net
PATCH 7/7 clean build: Fix remaining sh4 warnings
In reply to Jan Kiszka---
hw/shix.c | 15 --------------- target-sh4/cpu.h | 2 ++ target-sh4/exec.h | 6 ------ target-sh4/helper.c | 14 +++++++------- 4 files changed, 9 insertions(+), 28 deletions(-)
hw/shix.c +0 -15
@@ -46,21 +46,6 @@ void pic_info(void)/* XXXXX */ } -void vga_update_display (void ) -{ -/* XXXXX */ -} - -void vga_invalidate_display (void ) -{ -/* XXXXX */ -} - -void vga_screen_dump (const char *filename) -{ -/* XXXXX */ -} - static void shix_init(ram_addr_t ram_size, int vga_ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline,
target-sh4/cpu.h +2 -0
@@ -163,6 +163,8 @@ static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls) env->gbr = newtls; } +void cpu_load_tlb (CPUSH4State * env); +#include "softfloat.h" #define CPUState CPUSH4State
target-sh4/exec.h +0 -6
@@ -53,10 +53,4 @@ static inline void env_to_regs(void) /* XXXXX */ } -void cpu_load_tlb (CPUState * env); - -int find_itlb_entry (CPUState * env,target_ulong address, -int use_asid,int update); -int find_utlb_entry (CPUState * env,target_ulong address,int use_asid); -#endif /* _EXEC_SH4_H */
target-sh4/helper.c +7 -7
@@ -313,8 +313,8 @@ static void increment_urc(CPUState * env)Return entry, MMU_ITLB_MISS, MMU_ITLB_MULTIPLE or MMU_DTLB_MULTIPLE Update the itlb from utlb if update is not 0 */ -int find_itlb_entry (CPUState * env,target_ulong address, -int use_asid,int update) +static int find_itlb_entry (CPUState * env,target_ulong address, +int use_asid,int update) {int e, n;
@@ -344,7 +344,7 @@ int find_itlb_entry(CPUState * env, target_ulong address,/* Find utlb entry Return entry, MMU_DTLB_MISS, MMU_DTLB_MULTIPLE */ -int find_utlb_entry (CPUState * env,target_ulong address,int use_asid) +static int find_utlb_entry (CPUState * env,target_ulong address,int use_asid) {/* per utlb access */ increment_urc (env);
@@ -418,9 +418,9 @@ static int get_mmu_address(CPUState * env, target_ulong * physical,return n; } -int get_physical_address (CPUState * env,target_ulong * physical, -int *prot,target_ulong address, -int rw,int access_type) +static int get_physical_address (CPUState * env,target_ulong * physical, +int *prot,target_ulong address, +int rw,int access_type) {/* P1, P2 and P4 areas do not use translation */ if ((address >= 0x80000000 && address < 0xc0000000) ||
@@ -525,7 +525,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState * env, target_ulong addr)return physical; } -void cpu_load_tlb (CPUState * env) +void cpu_load_tlb (CPUSH4State * env) {int n =cpu_mmucr_urc (env->mmucr);tlb_t * entry = &env->utlb[n];
Quoted 5 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
Quoted 8 lines
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)
This means that after applying your patch there should be no more warning for the ARM target?
On my machine (x86_64, gcc 4.1.2), I still get these:
CC arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s8’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v1’ is used uninitialized in this function /home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v2’ is used uninitialized in this function /home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v3’ is used uninitialized in this function /home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v4’ is used uninitialized in this function /home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s16’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v1’ is used uninitialized in this function /home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v2’ is used uninitialized in this function /home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s32’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ‘vdest.v1’ is used uninitialized in this function
Note a patch has been proposed in the past (by Aurélien IIRC).
Laurent
Quoted 9 lines · Laurent Desnogues
Quoted 8 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Quoted 8 lines
Quoted 5 lines
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)This means that after applying your patch there should be no more warning for the ARM target?
At least for softmmu, at least with my compiler (depending on the precise version / distro patches, you may have different warnings enabled by default): yes.
Quoted 16 lines
On my machine (
x86_64, gcc 4.1.2), I still get these:CC
arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s8’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v3’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v4’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s16’:
Quoted 8 lines
/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s32’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ‘vdest.v1’ is used uninitialized in this function
Has this been identified as a real issue or just compiler blindness (my series contains one "fix" for such blindness, see cris patch)? I'm currently a bit lost in those macros...
Quoted 2 lines
Note a patch has been proposed in the past (by Aurélien IIRC).
Do you have a reference at hand?
Jan
Quoted 48 lines · Jan Kiszka
Quoted 9 lines · Laurent Desnogues
Quoted 8 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Quoted 8 lines
Quoted 5 lines
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)This means that after applying your patch there should be no more warning for the ARM target?
At least for softmmu, at least with my compiler (depending on the precise version / distro patches, you may have different warnings enabled by default): yes.
Quoted 16 lines
On my machine (
x86_64, gcc 4.1.2), I still get these:CC
arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ?helper_neon_rshl_s8?:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v1? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v2? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v3? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v4? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ?helper_neon_rshl_s16?:Quoted 8 lines
/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ?vdest.v1? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ?vdest.v2? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ?helper_neon_rshl_s32?:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ?vdest.v1? is used uninitialized in this function
Quoted 2 lines
Has this been identified as a real issue or just compiler blindness (my series contains one "fix" for such blindness, see cris patch)? I'm
Sorry, I missed any posted CRIS patch. Please post it again if you have one and please CC me and I'll apply it if I agree with it.
Sorry if I missed your email.
Best regards,
Edgar
Quoted 9 lines
currently a bit lost in those macros...
Quoted 2 lines
Note a patch has been proposed in the past (by Aurélien IIRC).
Do you have a reference at hand?
Jan
Quoted 45 lines · Edgar E. Iglesias
Quoted 44 lines · Jan Kiszka
Quoted 9 lines · Laurent Desnogues
Quoted 8 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Quoted 7 lines
Quoted 5 lines
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)This means that after applying your patch there should be no more warning for the ARM target?
At least for softmmu, at least with my compiler (depending on the precise version / distro patches, you may have different warnings enabled by default): yes.
Quoted 23 lines
On my machine (
x86_64, gcc 4.1.2), I still get these:CC
arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ?helper_neon_rshl_s8?:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v1? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v2? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v3? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ?vdest.v4? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ?helper_neon_rshl_s16?:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ?vdest.v1? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ?vdest.v2? is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ?helper_neon_rshl_s32?:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ?vdest.v1? is used uninitialized in this function
Quoted 7 lines
Quoted 2 lines
Has this been identified as a real issue or just compiler blindness (my series contains one "fix" for such blindness, see cris patch)? I'm
Sorry, I missed any posted CRIS patch. Please post it again if you have one and please CC me and I'll apply it if I agree with it.
Sorry if I missed your email.
There is nothing you missed, I was referring to patch 5 of this series. I'll sent out a fixed version soon and put you on CC this time.
The point is that I lost a bit interest in building up proper CC lists here due to the (IMHO) broken list configuration of inserting reply-to headers. That way CCs typically get lost when someone picks up a thread from the list. Unfortunately, no one replied on my RFC [1] to fix this (because I forgot the proper CCs? :->).
Jan
[1] http://permalink.gmane.org/gmane.comp.emulators.qemu/28472
Quoted 16 lines · Jan Kiszka
Quoted 15 lines · Laurent Desnogues
Quoted 13 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)
Quoted 6 lines
Quoted 2 lines
This means that after applying your patch there should be no more warning for the ARM target?
At least for softmmu, at least with my compiler (depending on the precise version / distro patches, you may have different warnings enabled by default): yes.
I built softmmu and my Makefile has no other warning than the default.
Quoted 25 lines
Quoted 16 lines
On my machine (
x86_64, gcc 4.1.2), I still get these:CC
arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s8’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v3’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v4’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s16’:Quoted 8 lines
/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s32’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ‘vdest.v1’ is used uninitialized in this function
Quoted 3 lines
Has this been identified as a real issue or just compiler blindness (my series contains one "fix" for such blindness, see cris patch)? I'm currently a bit lost in those macros...
Yes, it's a real bug: dest has not been given a value. You can look at preprocessed code :-) BTW, can gcc really say a value is used uninitialized? I have seen it pretending "may be used uninitialized" though it is, but it was always right when it says "is used uninitialized".
Quoted 4 lines
Quoted 2 lines
Note a patch has been proposed in the past (by Aurélien IIRC).
Do you have a reference at hand?
Try this:
http://article.gmane.org/gmane.comp.emulators.qemu/31206
HTH,
Laurent
Quoted 48 lines · Laurent Desnogues
Quoted 15 lines · Jan Kiszka
Quoted 14 lines · Laurent Desnogues
Quoted 13 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)Quoted 5 lines
Quoted 2 lines
This means that after applying your patch there should be no more warning for the ARM target?
At least for softmmu, at least with my compiler (depending on the precise version / distro patches, you may have different warnings enabled by default): yes.
I built softmmu and my
Makefilehas no other warning than the default.Quoted 23 lines
Quoted 23 lines
On my machine (
x86_64, gcc 4.1.2), I still get these:CC
arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s8’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v3’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v4’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s16’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s32’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ‘vdest.v1’ is used uninitialized in this function
Quoted 6 lines
Quoted 3 lines
Has this been identified as a real issue or just compiler blindness (my series contains one "fix" for such blindness, see cris patch)? I'm currently a bit lost in those macros...
Yes, it's a real bug: dest has not been given a value. You can look at preprocessed code :-)
Yeah, preprocessed and Lindent'ed, this looks really buggy.
Quoted 4 lines
BTW, can gcc really say a value
is used uninitialized? I have seen it pretending "may be used uninitialized" though it is, but it was always right when it says "is used uninitialized".
Obviously, detecting uninitialized variables with gcc still leaves room for improvement. Version 4.3 actually seem to have regressed in this case.
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Note a patch has been proposed in the past (by Aurélien IIRC).
Do you have a reference at hand?
Try this:
OK, that makes sense, partially. My feeling is that there are some more typos/thinkos in this code. First, the macro for 8/16/32 bit checks for a shift width of -8/-16/-32, but the 64-bit version uses -63?! And then we have this (for signed rshl):
dest = src >> (width - 1);
dest++;
dest >>= 1;
Looks like nothing else than dest = 0, no? Paul?
Jan
Quoted 75 lines · Jan Kiszka
Quoted 47 lines · Laurent Desnogues
Quoted 15 lines · Jan Kiszka
Quoted 14 lines · Laurent Desnogues
Quoted 13 lines · Jan Kiszka
When working on larger or intrusive changes like the monitor rework, the number of warnings a normal build generates (here: x86-64 host, gcc 4.3) is still too high. And sometimes these warnings are not just of cosmetic nature, see (reposted) patch 3.
This series reduces the number of warnings significantly, still not to zero (someone would have to look into the NetWinder stuff), but almost:
Warning summary for 2009-02-21 (changes since 2009-02-21-base)
generic 0 (-1) softmmu 0 (-39) x86 0 (0) arm 0 (-10)Quoted 5 lines
Quoted 2 lines
This means that after applying your patch there should be no more warning for the ARM target?
At least for softmmu, at least with my compiler (depending on the precise version / distro patches, you may have different warnings enabled by default): yes.
I built softmmu and my
Makefilehas no other warning than the default.Quoted 23 lines
Quoted 23 lines
On my machine (
x86_64, gcc 4.1.2), I still get these:CC
arm-softmmu/neon_helper.o/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s8’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v3’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:469:
warning: ‘vdest.v4’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s16’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v1’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:470:
warning: ‘vdest.v2’ is used uninitialized in this function/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c: In function ‘helper_neon_rshl_s32’:/home/ldesnogu/work/Emu/qemu/svn-ref/target-arm/neon_helper.c:471:
warning: ‘vdest.v1’ is used uninitialized in this functionQuoted 5 lines
Quoted 3 lines
Has this been identified as a real issue or just compiler blindness (my series contains one "fix" for such blindness, see cris patch)? I'm currently a bit lost in those macros...
Yes, it's a real bug: dest has not been given a value. You can look at preprocessed code :-)
Yeah, preprocessed and Lindent'ed, this looks really buggy.
Quoted 4 lines
BTW, can gcc really say a value
is used uninitialized? I have seen it pretending "may be used uninitialized" though it is, but it was always right when it says "is used uninitialized".Obviously, detecting uninitialized variables with gcc still leaves room for improvement. Version 4.3 actually seem to have regressed in this case.
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
Note a patch has been proposed in the past (by Aurélien IIRC).
Do you have a reference at hand?
Try this:
OK, that makes sense, partially. My feeling is that there are some more typos/thinkos in this code. First, the macro for 8/16/32 bit checks for a shift width of -8/-16/-32, but the 64-bit version uses -63?! And then we have this (for signed rshl):
Quoted 5 lines
dest = src >> (width - 1);
dest++;
dest >>= 1;Looks like nothing else than dest = 0, no? Paul?
One more:
[NEON_FN for rshl_s8/16/32]
...
} else if (tmp == -sizeof(src1) * 8) { \
dest = src1 >> (tmp - 1); \
ie.
if (tmp == -8/-16/-32) {
dest = src1 >> (-9/-17/-33);Jan