This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
-fstrict-aliasing
- From: John Parkes <jp012c6013 at blueyonder dot co dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 4 Jun 2004 15:45:35 +0100
- Subject: -fstrict-aliasing
Is GCC permitted to miscompile, with -fstrict-aliasing, source
which clearly flouts the assumptions of that option ?
eg.
#include <stdio.h>
unsigned int x, y;
float i, j;
int r;
int main()
{
x = 0xFFFFFFFE;
y = 0xCBFFFFFE;
i = *(float*)&x;
j = *(float*)&y;
r = i<=j;
printf("result = %d\n", r);
return 0;
}
TIA, John Parkes