This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35764] New: improper load from volatile
- From: "regehr at cs dot utah dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Mar 2008 04:18:26 -0000
- Subject: [Bug c/35764] New: improper load from volatile
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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