This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]