This is for "gcc version 4.3.0 (GCC)"
This is very likely related to 35729 and 35762.
This code:
extern int bar (void);
volatile int g_156;
int foo (void)
{
if (bar ())
return 0;
else
return g_156;
}
Compiled with:
gcc -O1 -S foo.c
Gives:
foo:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
call bar
cmpl $1, %eax
sbbl %eax, %eax
andl g_156, %eax
leave
ret
The unconditional load from volatile g_156 is incorrect.
--
Summary: improper load from volatile
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35764