[Bug middle-end/84309] New: [8 Regression] Wrong-code with -ffast-math
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 9 12:36:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84309
Bug ID: 84309
Summary: [8 Regression] Wrong-code with -ffast-math
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
Target: x86_64-pc-linux-gnu
typedef __SIZE_TYPE__ size_t;
double pow (double x, double y);
double log2 (double x);
int
main ()
{
size_t a = 1024;
size_t b = 16 * 1024;
size_t c = pow (2, (log2 (a) + log2 (b)) / 2);
if (c != 4 * 1024)
__builtin_abort ();
return 0;
}
$ xgcc x.c -lm; ./a.out
$ xgcc x.c -lm -ffast-math; ./a.out
Aborted (core dumped)
More information about the Gcc-bugs
mailing list