public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40628]  New: Assignment using "= trim(string)": Optimize "trim" away
@ 2009-07-03  7:16 burnus at gcc dot gnu dot org
  2009-07-05  9:14 ` [Bug fortran/40628] " fxcoudert at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-03  7:16 UTC (permalink / raw)
  To: gcc-bugs

In assignments, such as
  string = trim(string)
  string(n1:n2) = trim(string)
the trim has no effect and can be optimized away.

(Note: With Fortran 2003 and allocatable strings with "len=:", the first
version cannot be optimized as on length mismatch the LHS is reallocated.)

Such code can easily be present in real-world code and causes unnecessarily a
large overhead, cf. e.g. http://www.tddft.org/trac/octopus/changeset/5672


-- 
           Summary: Assignment using "= trim(string)": Optimize "trim" away
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-07-25 19:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-03  7:16 [Bug fortran/40628] New: Assignment using "= trim(string)": Optimize "trim" away burnus at gcc dot gnu dot org
2009-07-05  9:14 ` [Bug fortran/40628] " fxcoudert at gcc dot gnu dot org
2010-06-18 21:12 ` tkoenig at gcc dot gnu dot org
2010-06-18 21:19 ` burnus at gcc dot gnu dot org
2010-07-25 19:32 ` tkoenig at gcc dot gnu dot org
2010-07-25 19:37 ` tkoenig at gcc dot gnu dot 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).