[Bug c/64255] [5 Regression] failures with -O2 optimization on i >= 0 ? (unsigned long) i : - (unsigned long) i
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 10 17:29:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64255
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|WAITING |NEW
CC| |trippels at gcc dot gnu.org
Target Milestone|--- |5.0
Summary|failures with -O2 |[5 Regression] failures
|optimization on i >= 0 ? |with -O2 optimization on i
|(unsigned long) i : - |>= 0 ? (unsigned long) i :
|(unsigned long) i |- (unsigned long) i
Severity|major |normal
--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Confirmed. Testcase can be combined to one file:
markus@x4 tmp % cat test.c
#include <stdio.h>
__attribute__((noinline))
int f (long i)
{
if (i == 0)
{
return 0;
}
else
{
unsigned long ai;
ai = i >= 0 ? (unsigned long) i : - (unsigned long) i;
if ((i >= 0 ? (unsigned long) i : - (unsigned long) i) != ai)
printf ("Error!\n");
printf ("i = %ld\n", i);
printf ("ai = %lX\n", ai);
return 0;
}
}
int main (void)
{
f (1);
return 0;
}
More information about the Gcc-bugs
mailing list