This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimizer bugs fixed with I/O?



On Oct 31, 2004, at 10:40 PM, Scott Robert Ladd wrote:


Maybe I had too much coffee, or not enough, but while testing a fix for the power.f90 failures, I encountered something strange.

Compiled with "gfortran power.f90", the program correctly prints

 okay, c =  ( -5.000000    ,  12.00000    )
       z =  (  0.000000    ,-9.5367432E-07)
       t =   9.5367432E-07

Compiled with -O1, the program prints:

 broken, c =  ( -5.000000    ,  12.00000    )
         z =  (  0.000000    ,-9.5367432E-07)
         t =    13.00000

Removing the comment from "write (*,*) 'fix it'" allows the program to compile correctly with -O1.

I'm assuming the write statement changes the statement sequence such that the optimizer doesn't break the program. I've not had a chance to investigate further, and want to be certain that this isn't some failure of my mental capacity or a commonly-known bug. I didn't see anything in bugzilla, but that doesn't mean it isn't there.

This is most likely the same bug as PR 17603.
Either this is middle-end bug in expand or it could be an RTL optimization
problem because it works for me on powerpc-darwin.


Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]