[Bug target/60062] [4.7/4.9 Regression] wrong code (for code with the optimize attribute) at -O1 and above on x86_64-linux-gnu in 32-bit mode
su at cs dot ucdavis.edu
gcc-bugzilla@gcc.gnu.org
Wed Feb 5 15:43:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60062
--- Comment #5 from Zhendong Su <su at cs dot ucdavis.edu> ---
(In reply to Jakub Jelinek from comment #4)
> *** Bug 60072 has been marked as a duplicate of this bug. ***
The testcase below is most likely another dup as the only difference is that it
affects the trunk at -Os only. Just include it here for reference. Thanks.
----------------------------------
int printf (const char *, ...);
int a;
int
fn1 (unsigned char p1)
{
return p1 % p1;
}
static void
fn2 (char *p1, int p2)
{
if (p2)
printf (p1);
}
__attribute__ ((optimize (0)))
int fn3 (short p1, short p2)
{
a = 0;
return 0;
}
__attribute__ ((optimize (1)))
int fn4 ()
{
fn3 (0, 0);
if (fn1 (1))
for (;;)
;
return 1;
}
__attribute__ ((optimize (0)))
int main ()
{
fn4 ();
fn2 ("", 0);
return 0;
}
More information about the Gcc-bugs
mailing list