[Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os
doko at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 2 19:33:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57149
Bug #: 57149
Summary: [4.8 Regression] wrong -Wmaybe-uninitialized warning
with -Os
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: doko@gcc.gnu.org
Created attachment 30007
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30007
preprocessed source
seen when building a driver in an arm linux 3.4 kernel, the warning shows up
when building with -Os, but not when building with -O[g123], works with all
optimization levels in 4.7.3.
$ gcc -Wall -Wno-unused-but-set-variable -Os -marm -mapcs -mabi=aapcs-linux
-march=armv7-a -msoft-float -g -c ci13xxx_msm.i)
In file included from drivers/usb/gadget/ci13xxx_msm.c:21:0:
drivers/usb/gadget/ci13xxx_msm.c: In function 'msm_udc_irq':
drivers/usb/gadget/ci13xxx_udc.c:2544:13: warning: 'err' may be used
uninitialized in this function [-Wmaybe-uninitialized]
dbg_event(_usb_addr(mEp), "ERROR", err);
^
drivers/usb/gadget/ci13xxx_udc.c:2357:23: note: 'err' was declared here
int type, num, dir; int err = -EINVAL;
^
$ gcc -Wall -Wno-unused-but-set-variable -Og -marm -mapcs -mabi=aapcs-linux
-march=armv7-a -msoft-float -g -c ci13xxx_msm.i
$
More information about the Gcc-bugs
mailing list