Hi:
  use gcc4.1.2 on x86_64/linux, for example:
 main()
{
   long long int a;
   double b;
   a=4607182418800017408;
   b=*(double *)&a;
   printf("%f\n",b);
}
if using -O0/-O1 optimization, the result is 1.000000;
but if using -O2/-O3 optimization,the result is 0.000000.
i have try to close -fno-strict-aliasing in -O2/-O3, the result will be same as
-O0/-O1.

so i think the strict-aliasing may have some bug!!!


-- 
           Summary: strict-aliasing error
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: baisjing at yahoo dot com dot cn


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38588

Reply via email to