This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Feb 2012 09:53:11 +0000
- Subject: [Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52243
Bug #: 52243
Summary: Avoid reallocation for: array1 = array1 / scalar for
performance
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: pault@gcc.gnu.org
Some testing with -Wrealloc-lhs (PR 52196) showed that it is rather common to
encounter the following code.
gfortran inserts a reallocation check - but as the same array is on the LHS and
on the RHS, the LHS must be allocated with the correct shape is the same.
Hence, no reallocation check should be inserted (missed optimization):
nablamat=nablamat*hescale
kpoints=kpoints/scale
hreal=hreal/cmplx(real(nkpts),0.0)
y2 = y2 + y
ylm = conjg( ylm )
phasusbmat=conjg(phasusbmat)
cc = det * transpose(cc)