optimization bug

Tim Prince timothyprince@sbcglobal.net
Mon Mar 10 15:36:00 GMT 2003


On Monday 10 March 2003 05:28, surjan@coulson.chem.elte.hu wrote:
> Dear Sir:
>          The attached fortran code, named optbug.f, compiles
> with g77 without any message. I use gcc-g77-2.96-112.7.2. Issuing the
> command
>
>                            g77 -o bug optbug.f
> or
>                            g77 -O1 -o bug optbug.f
> we get an executable producing the correct result:
>                          /scr/surjan> bug
>                           1 -1
> while optimizing the compilation with O2 or higher
>                             g77 -O2 -o bug2 optbug.f
> produces the erroneous answer:
>                         /scr/surjan> bug2
>                           1 -100
>
The current snapshot gcc-3.3/g77 produces your correct result.  gcc-2.96 was 
not a gnu version, and is no longer maintained by anybody.  If I may say so, 
it's an abomination and I have it on one of my systems only because I just 
had to rebuild it after a crash.
-- 
Tim Prince



More information about the Gcc-bugs mailing list