Bug 21859 - ICE with -ftree-vectorize and -O2 or higher
Summary: ICE with -ftree-vectorize and -O2 or higher
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on: 22228
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-01 10:11 UTC by Frank Victor Fischer
Modified: 2005-09-25 23:37 UTC (History)
1 user (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-06-01 12:15:33


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Victor Fischer 2005-06-01 10:11:05 UTC
Compiling this piece of code: 
 
c===================================================================      
SUBROUTINE SETGRDREC (NMREC,ZREC,KK,Z,IREC) 
      DIMENSION Z(KK) 
      DIMENSION ZREC(NMREC,KK) 
 
      i = 0 
      DO K=1,KK 
        ZREC(IREC,I) = Z(I) 
      ENDDO 
      END 
c=================================================================== 
 
with the following command: 
 
gfortran -O2 -Wall -Wextra -ftree-vectorize -c bug.F -o bug.o 
 
results in: 
 
=================================================================== 
problem.F: In function 'setgrdrec': 
problem.F:1: error: Definition in block 2 does not dominate use in block 5 
for SSA_NAME: TMT.7_31 in statement: 
#   TMT.7_25 = V_MAY_DEF <TMT.7_31>; 
(*zrec_28)[D.821_23] = lsm_tmp.9_15; 
problem.F:1: internal compiler error: verify_ssa failed. 
=================================================================== 
 
It compiles without problems without -ftree-vectorize or -O1 or lower. 
 
output of gfortran -v: 
=================================================================== 
Using built-in specs. 
Target: x86_64-unknown-linux-gnu 
Configured with: ./configure --prefix=/home/vici --enable-languages=f95 : 
(reconfigured) ./configure --prefix=/home/vici --enable-languages=f95 
Thread model: posix 
gcc version 4.1.0 20050601 (experimental) 
=================================================================== 
 
Output of uname -a: 
 
Linux galadriel 2.6.11.4-20a-default #1 Wed Mar 23 21:52:37 UTC 2005 x86_64 
x86_64 x86_64 GNU/Linux
Comment 1 Dorit Naishlos 2005-06-01 11:13:25 UTC
I can reproduce this on powerpc-apple-darwin.

Maybe a duplicate of PR21831.

Hopefully will be resolved by Keith's work 
(http://gcc.gnu.org/ml/gcc-patches/2005-05/msg02478.html)
Comment 2 Andrew Pinski 2005-06-01 12:15:33 UTC
Confirmed based on Dorit's comment.
Comment 3 Dorit Naishlos 2005-06-07 07:50:49 UTC
This testcase doesn't get vectorized anymore, after my patch from 
http://gcc.gnu.org/ml/gcc-patches/2005-05/msg02817.html:

"pr21859.f90:6: note: not vectorized: redundant loop. no profit to vectorize.
pr21859.f90:1: note: vectorized 0 loops in function."

so it also doesn't ICE anymore. It might be that it's just avoiding the 
problem, but I also can't reproduce PR21831, which is a duplicate of this one, 
and which was not affected by my patch, so it might be that something else 
fixed the problem (don't know what). 
Comment 4 Wolfgang Bangerth 2005-06-28 23:25:52 UTC
This may be the same as PR 22228, which still fails as of today... 
 
W. 
Comment 5 Andrew Pinski 2005-06-28 23:29:59 UTC
(In reply to comment #4)
> This may be the same as PR 22228, which still fails as of today... 

I really doubt it because this only involves one loop and the other involves multiple loops.
Comment 6 Andrew Pinski 2005-09-25 23:37:10 UTC
Fixed.