[Bug tree-optimization/79327] New: wrong code at -O2 and -ftree-printf-return
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 1 16:35:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79327
Bug ID: 79327
Summary: wrong code at -O2 and -ftree-printf-return
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
The following aborts with -O2:
volatile int a, b = -1;
char buf[64];
int
main ()
{
int c = a;
int d = b;
if (c >= -35791395 && c < 35791394 && d >= -1 && d < __INT_MAX__)
{
int e = __builtin_sprintf (buf, "%+03d%02d", c + 1, d + 1);
if (e > 7)
__builtin_abort ();
}
return 0;
}
-fno-printf-return-value helps.
More information about the Gcc-bugs
mailing list