An ICE with gfortran 4.6.1, optimization -O3, not with -O2.

Steve Kargl sgk@troutmask.apl.washington.edu
Wed Aug 24 17:45:00 GMT 2011


On Wed, Aug 24, 2011 at 07:31:54PM +0200, Toon Moene wrote:
> On 08/23/2011 11:05 PM, Steve Kargl wrote:
> 
> >On Tue, Aug 23, 2011 at 01:45:21PM -0700, Steve Kargl wrote:
> 
> >>It's this statement:
> >>
> >>       xkcoef(npne(jn)+jm)=-zxxx*(zjm**2+zjn**2)**0.5_jprb
> >>
> >>in subroutine posnam that is causing the ICE.  If one
> >>uses the good old fashion sqrt(), the code compiles.
> 
> >Here's the reduce test case that Toon meant to send.
> 
> :-)
> 

It was an interesting exercise to reduce the code.
This block of code must real confuse something in 
the middle-end:

   jn=0
   do jm=0,ncpln(jn)
      zjm=real(jm,jprb) / elx
      xkcoef(npne(jn)+jm) = - zxxx*(zjm**2)**0.5_jprb
   end do

If one removes '/ elx', the code compiles with -O3.
If one puts '/ elx' back and removes 'zxxx *', then 
the code compiles.  If one restores the 'zxxx *' and
changes the '**0.5_jprb' to use a sqrt(), the code
compiles.

-- 
Steve



More information about the Fortran mailing list