public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52243] New: Avoid reallocation for:  array1 = array1 / scalar  for performance
@ 2012-02-14  9:53 burnus at gcc dot gnu.org
  2013-08-28 21:06 ` [Bug fortran/52243] " tkoenig at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-14  9:53 UTC (permalink / raw)
  To: gcc-bugs

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)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/52243] Avoid reallocation for:  array1 = array1 / scalar  for performance
  2012-02-14  9:53 [Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance burnus at gcc dot gnu.org
@ 2013-08-28 21:06 ` tkoenig at gcc dot gnu.org
  2013-08-29 11:44 ` tkoenig at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-08-28 21:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52243

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-08-28
           Assignee|unassigned at gcc dot gnu.org      |tkoenig at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
I have a patch.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/52243] Avoid reallocation for:  array1 = array1 / scalar  for performance
  2012-02-14  9:53 [Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance burnus at gcc dot gnu.org
  2013-08-28 21:06 ` [Bug fortran/52243] " tkoenig at gcc dot gnu.org
@ 2013-08-29 11:44 ` tkoenig at gcc dot gnu.org
  2013-08-29 11:45 ` tkoenig at gcc dot gnu.org
  2013-08-29 11:46 ` tkoenig at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-08-29 11:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52243

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Thu Aug 29 11:44:41 2013
New Revision: 202070

URL: http://gcc.gnu.org/viewcvs?rev=202070&root=gcc&view=rev
Log:
2013-08-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/52243
    * trans-expr.c (is_runtime_conformable):  New function.
    * gfc_trans_assignment_1:  Use it.

2013-08-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/52243
    * gfortran.dg/realloc_on_assign_14.f90:  Remove warning made
    obsolete by patch.
    * gfortran.dg/realloc_on_assign_19.f90:  New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/realloc_on_assign_19.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/realloc_on_assign_14.f90


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/52243] Avoid reallocation for:  array1 = array1 / scalar  for performance
  2012-02-14  9:53 [Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance burnus at gcc dot gnu.org
  2013-08-28 21:06 ` [Bug fortran/52243] " tkoenig at gcc dot gnu.org
  2013-08-29 11:44 ` tkoenig at gcc dot gnu.org
@ 2013-08-29 11:45 ` tkoenig at gcc dot gnu.org
  2013-08-29 11:46 ` tkoenig at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-08-29 11:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52243

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Fixed on trunk, closing.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/52243] Avoid reallocation for:  array1 = array1 / scalar  for performance
  2012-02-14  9:53 [Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-08-29 11:45 ` tkoenig at gcc dot gnu.org
@ 2013-08-29 11:46 ` tkoenig at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-08-29 11:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52243

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Really closing :-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-29 11:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-14  9:53 [Bug fortran/52243] New: Avoid reallocation for: array1 = array1 / scalar for performance burnus at gcc dot gnu.org
2013-08-28 21:06 ` [Bug fortran/52243] " tkoenig at gcc dot gnu.org
2013-08-29 11:44 ` tkoenig at gcc dot gnu.org
2013-08-29 11:45 ` tkoenig at gcc dot gnu.org
2013-08-29 11:46 ` tkoenig at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).