optimization bug in gcc-2.95

Nathan Sidwell nathan@acm.org
Tue Aug 31 22:45:00 GMT 1999


Blair Kelly III wrote:

> main()
> {
>   long p1;
>   double x = ((double) 10) * ((double) 10);
>   double t = x+(4503599627370496.0);  /* 2^52 */
>   long *lo = (long *)&t;
>   p1 =  lo[1];
>   printf("%d\n",p1);
> }
This looks like you've broken the type based alias rules (i.e. your program
invokes undefined behaviour). See http://egcs.cygnus.com/faq.html#linuxkernel
for details.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
        I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk



More information about the Gcc-bugs mailing list