public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53591] New: Front-end optimize empty string assignments
@ 2012-06-06 13:30 burnus at gcc dot gnu.org
  2012-06-07 11:16 ` [Bug fortran/53591] " tkoenig at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-06-06 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53591
           Summary: Front-end optimize empty string assignments
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: tkoenig@gcc.gnu.org


Based on PR 52861.

I think it would be useful to front-end optimize (frontend-passes.c's
optimize_assignment, utilizing empty_string()):

  character(len=5) :: str
  str = ' '

  [That will create a memmove/memcpy followed by a memset.]

to either

  str = '' (RHS length = 0)

  [This will use a memset]

or to

  str = '     ' (RHS length = LHS length)

  [That will use an assignment]

Currently, the middle-end likes a direct assignment better than a memset, but
everything which avoids memmove/memcpy is good.

Cf. also trans-expr.c's gfc_trans_string_copy.


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

* [Bug fortran/53591] Front-end optimize empty string assignments
  2012-06-06 13:30 [Bug fortran/53591] New: Front-end optimize empty string assignments burnus at gcc dot gnu.org
@ 2012-06-07 11:16 ` tkoenig at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-06-07 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-06-07 11:16:46 UTC ---
Also fixed with the commit for PR 52861.

Closing.


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

end of thread, other threads:[~2012-06-07 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06 13:30 [Bug fortran/53591] New: Front-end optimize empty string assignments burnus at gcc dot gnu.org
2012-06-07 11:16 ` [Bug fortran/53591] " 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).