This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/32946] New: ICE (segfault) when compiling with -O3 (-fpredictive-commoning)


consider the following code:


module mo

contains

subroutine sub(epstab)
    implicit none
    real epstab(52)
    integer i,ib,ib2,ie

    do i = 1, ie
       ib2 = ib+2
       epstab(ib) = epstab(ib2)
       ib = ib2
    end do

  end subroutine sub

end module mo


this fails with an ICE (segmentation fault) when it is compiled with -O3, but
shows no problems with -O2. I found that the flag which causes this is
-fpredictive-commoning (but this only causes the segfault in combination with
-O1 or -O2).

to sum up, the following sets of flags cause a segfault for me:
* gfortran-4.3 -O3
* gfortran-4.3 -O2 -fpredictive-commoning
* gfortran-4.3 -O1 -fpredictive-commoning

in contrast, the following flags cause no segfault:
* gfortran-4.3 -O1
* gfortran-4.3 -O2
* gfortran-4.3 -fpredictive-commoning

I'm using GCC trunk rev 127088 on i686-pc-linux-gnu.


-- 
           Summary: ICE (segfault) when compiling with -O3 (-fpredictive-
                    commoning)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jaydub66 at gmail dot com


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


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