[Bug fortran/33341] New: unnecessary stores for array constructor
tkoenig at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 7 20:17:00 GMT 2007
The following idiom causes unnecessary runtime
overhead:
$ cat compare.f90
function foo(a,b,c,d)
logical :: foo
integer, intent(in):: a,b,c,d
foo = all((/ a, b, c /) /= d)
end function foo
$ gfortran -fdump-tree-optimized -O3 -S compare.f90
The *.optimized file shows
<bb 2>:
D.521 = (int4[0:] *) &A.2;
D.522 = *a;
(*D.521)[0] = D.522;
D.523 = *b;
(*D.521)[1] = D.523;
D.524 = *c;
(*D.521)[2] = D.524;
D.516 = *d;
The stores are unneeded, as the array itself could
be eliminated.
--
Summary: unnecessary stores for array constructor
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33341
More information about the Gcc-bugs
mailing list