public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30409]  New: [fortran] missed optimization with pure function arguments
@ 2007-01-08 21:31 kargl at gcc dot gnu dot org
  2007-01-08 21:32 ` [Bug fortran/30409] " kargl at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-01-08 21:31 UTC (permalink / raw)
  To: gcc-bugs

The attached code demonstrates a missed optimization opportunity that
can have a severe impact on code.  Here are the timings for the 2 loops
on 2 GHz pentium4-m processor.

laptop:kargl[208] gfc4x -o z -O2 a.f90
laptop:kargl[209] ./z
 time 1:   5.0741002E-02
 time 2:    31.28215    

For a pure function the arguments are not changed during execution.  Thus,
in the second loop, the 1/y can be hoisted out of the nested loops.  Currently,
gfortran allocates/deallocates a temp array with every iteration on the 
outer loop, and it does the 1/y array operation on every iteration.


-- 
           Summary: [fortran] missed optimization with pure function
                    arguments
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kargl at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <bug-30409-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2023-10-23 21:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-08 21:31 [Bug fortran/30409] New: [fortran] missed optimization with pure function arguments kargl at gcc dot gnu dot org
2007-01-08 21:32 ` [Bug fortran/30409] " kargl at gcc dot gnu dot org
2007-01-08 21:36 ` kargl at gcc dot gnu dot org
2007-01-09 11:11 ` rguenth at gcc dot gnu dot org
2007-01-09 16:08 ` kargl at gcc dot gnu dot org
     [not found] <bug-30409-4@http.gcc.gnu.org/bugzilla/>
2010-10-02  8:10 ` tkoenig at gcc dot gnu.org
2023-10-22 16:43 ` kargl at gcc dot gnu.org
2023-10-22 19:18 ` anlauf at gcc dot gnu.org
2023-10-23  5:50 ` tkoenig at gcc dot gnu.org
2023-10-23 19:23 ` kargl at gcc dot gnu.org
2023-10-23 19:28 ` anlauf at gcc dot gnu.org
2023-10-23 21:45 ` kargl 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).