public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/40194]  New: fortran rules for optimizing
@ 2009-05-19  9:59 jv244 at cam dot ac dot uk
  2009-05-19 10:01 ` [Bug middle-end/40194] " jv244 at cam dot ac dot uk
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-05-19  9:59 UTC (permalink / raw)
  To: gcc-bugs

The return value of this function is known at compile time, but from looking at
dump-tree-optimized this seems not to be optimized as such.

INTEGER FUNCTION F1()
  INTEGER :: I1
  INTEGER, TARGET :: I2
  INTEGER, POINTER :: IP

  INTERFACE
    SUBROUTINE S(I1,I2)
      INTEGER,INTENT(IN) :: I1
      INTEGER, POINTER :: IP
    END SUBROUTINE S
  END INTERFACE

  I1=1
  I2=1
  IP=>I2
  CALL S(I1,IP)
  IP=2

  F1=I1
END FUNCTION F1

F1=1 can be infered from the fact that it is an intent(in) argument of S (so
the value cant be changed within S), and the fact that I1 does not have the
target attributed, so can not be 'aliased' with the pointer IP.


-- 
           Summary: fortran rules for optimizing
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

end of thread, other threads:[~2013-03-29  9:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40194-4@http.gcc.gnu.org/bugzilla/>
2012-06-29 14:14 ` [Bug middle-end/40194] fortran rules for optimizing Joost.VandeVondele at mat dot ethz.ch
2013-03-29  9:07 ` Joost.VandeVondele at mat dot ethz.ch
2009-05-19  9:59 [Bug middle-end/40194] New: " jv244 at cam dot ac dot uk
2009-05-19 10:01 ` [Bug middle-end/40194] " jv244 at cam dot ac dot uk
2009-05-19 10:14 ` jv244 at cam dot ac dot uk
2009-05-19 10:20 ` rguenth at gcc dot gnu dot org
2009-05-19 10:40 ` rguenth at gcc dot gnu dot org
2009-05-19 11:55 ` jv244 at cam dot ac dot uk
2009-05-19 12:04 ` rguenth at gcc dot gnu dot org
2009-05-19 12:11 ` rguenth at gcc dot gnu dot org
2009-08-13  7:23 ` jv244 at cam dot ac dot uk
2009-08-13 12:16 ` matz 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).