http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57517
Bug ID: 57517 Summary: internal compiler error: in eliminate_temp_copies, at tree-predcom.c:1913 Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: decker at envsci dot rutgers.edu The following code compiles at O2, but not O3. ~/test > gfortran481 -O3 -c module_diffusion_em.f90 module_diffusion_em.f90: In function ‘cal_helicity’: module_diffusion_em.f90:1:0: internal compiler error: in eliminate_temp_copies, at tree-predcom.c:1913 SUBROUTINE cal_helicity (uh, ph, phb, ht, ims, ime, jms, jme, kms, kme, & ^ 0xc81b7a eliminate_temp_copies ../../gcc-4.8.1/gcc/tree-predcom.c:1913 0xc81b7a tree_predictive_commoning_loop ../../gcc-4.8.1/gcc/tree-predcom.c:2519 0xc82277 tree_predictive_commoning() ../../gcc-4.8.1/gcc/tree-predcom.c:2554 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. ~/test > cat module_diffusion_em.f90 SUBROUTINE cal_helicity (uh, ph, phb, ht, ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte) INTEGER, INTENT( IN ) :: ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte REAL, DIMENSION( ims:ime , jms:jme ), INTENT( IN ) :: ht REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT( IN ) :: ph, phb REAL, DIMENSION( ims:ime, jms:jme ), INTENT( INOUT ) :: uh INTEGER :: i, j, k, ktf, i_start, i_end, j_start, j_end REAL :: zl, zu REAL, DIMENSION( its-2:ite+2, kts:kte, jts-2:jte+2 ) :: wavg, rvort real, parameter :: g = 9.81 DO j = j_start, j_end DO k = kts, ktf DO i = i_start, i_end zu = (( ph(i ,k+1,j ) + phb(i ,k+1,j ) ) / g - ht(i ,j ) ) + & (( ph(i-1,k+1,j ) + phb(i-1,k+1,j ) ) / g - ht(i-1,j ) ) + & (( ph(i ,k+1,j-1) + phb(i ,k+1,j-1) ) / g - ht(i ,j-1) ) IF ( zl .GE. 2000. .AND. zu .LE. 5000. ) THEN IF ( wavg(i,k,j) .GT. 0. .AND. wavg(i,k+1,j) .GT. 0. ) THEN uh(i,j) = uh(i,j) + ( wavg(i,k,j) * rvort(i,k,j) + & wavg(i,k+1,j) * rvort(i,k+1,j) ) * ( zu - zl ) ENDIF ENDIF END DO END DO END DO END SUBROUTINE cal_helicity ~/test > gfortran481 -v Using built-in specs. COLLECT_GCC=/home/decker/local/gcc481/bin/gfortran481 COLLECT_LTO_WRAPPER=/home/decker/local/gcc481/libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.8.1/configure --prefix=/home/decker/local/gcc481 --program-suffix=481 --enable-languages=c,c++,fortran --with-gmp=/home/decker/local --with-mpfr=/home/decker/local --with-mpc=/home/decker/local --with-isl=/home/decker/local --with-cloog=/home/decker/local Thread model: posix gcc version 4.8.1 (GCC)