[Bug fortran/71961] [7 Regression] 178.galgel in SPEC CPU 2000 is miscompiled

Joost.VandeVondele at mat dot ethz.ch gcc-bugzilla@gcc.gnu.org
Wed Jul 27 15:44:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71961

--- Comment #10 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
(In reply to Thomas Koenig from comment #9)
> With a test case, it would be OK with me if somebody reverted the
> patch. I can then rework it to take care of that particular bug.

A revert would be good I think.. this is a small testcase showing the wrong
results and the missing warning. I suspect it could be matmul specific.

> cat test.f90 
REAL, DIMENSION(:,:), POINTER :: a
REAL, DIMENSION(:,:), ALLOCATABLE :: b
ALLOCATE(a(4,4),b(4,2))
CALL RANDOM_NUMBER(a)
CALL RANDOM_NUMBER(b)
a(1:4,1:2)=MATMUL(a(1:4,1:4),b(1:4,1:2))
WRITE(6,*) a(1,1)
END

> gfortran -O0 -Warray-temporaries test.f90 ; ./a.out
test.f90:6:11:

 a(1:4,1:2)=MATMUL(a(1:4,1:4),b(1:4,1:2))
           1
Warning: Creating array temporary at (1) [-Warray-temporaries]
  0.770401359    

> gfortran -O1 -Warray-temporaries test.f90 ; ./a.out
  0.515214324


More information about the Gcc-bugs mailing list