public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13136] New: invalid "might be used uninitialized" warning (-O, long long)
@ 2003-11-20 7:57 gcc-bugzilla at gcc dot gnu dot org
2003-11-20 8:01 ` [Bug optimization/13136] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-11-20 7:57 UTC (permalink / raw)
To: gcc-bugs
GCC gives 'might be used uninitialized in this function' warning when
'long long' variable 'd' is first set to some value and then modified
in next line. Compiled with '-O -Wall'. 'long' type variable works ok.
Environment:
System: Linux haapana 2.4.22 #12 SMP Fri Nov 7 04:07:28 EET 2003 i686 unknown unknown GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: mcore-unknown-elf
configured with: /work/gcc/configure --target=mcore-elf --with-gnu-as --with-gcc --disable-nls --enable-languages=c,objc,c++ --with-gnu-ld --prefix=/emb/cross-gcc-current --program-prefix=mcore-elf- --program-suffix= -v --with-newlib --with-headers=/pub/devel/gnu/newlib-1.11.0/newlib/libc/include
How-To-Repeat:
/* ***** start of test.c ***** */
/* compile: mcore-elf-gcc -O -Wall -o test.o -c test.c */
int test(int c)
{
long long d;
d = 32000000LL << 1;
return (int)d;
}
/* ****** end of test.c ****** */
------- Additional Comments From sami dot kantoluoto at embedtronics dot fi 2003-11-20 07:57 -------
Fix:
Workaround: initialize 'd' variable to e.g. zero (0). Like:
int test(int c)
{
long long d = 0;
d = 32000000LL << 1;
return (int)d;
}
--
Summary: invalid "might be used uninitialized" warning (-O, long
long)
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sami dot kantoluoto at embedtronics dot fi
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mcore-unknown-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13136
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug optimization/13136] invalid "might be used uninitialized" warning (-O, long long)
2003-11-20 7:57 [Bug optimization/13136] New: invalid "might be used uninitialized" warning (-O, long long) gcc-bugzilla at gcc dot gnu dot org
@ 2003-11-20 8:01 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-20 8:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-20 08:01 -------
Related to bug 12792 (filed for m68k).
Actually I think its analysis is to be able to mark it as a dup of it then:
* life_analysis() does not track subregister modifications -- if you don't
modify the whole register with a single set, it considers the register
unused.
*** This bug has been marked as a duplicate of 12792 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13136
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-11-20 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-20 7:57 [Bug optimization/13136] New: invalid "might be used uninitialized" warning (-O, long long) gcc-bugzilla at gcc dot gnu dot org
2003-11-20 8:01 ` [Bug optimization/13136] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).