This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/41453] New: use INTENT(out) for optimization


In the following subroutine

SUBROUTINE S1()
  INTEGER :: a

  INTERFACE
    SUBROUTINE S2(a)
      INTEGER, INTENT(OUT) :: a
    END SUBROUTINE
  END INTERFACE

  a=7
  CALL S2(a)
END SUBROUTINE S1

The store 'a=7' is dead, and can be removed by the compiler, because it is an
INTENT(out) argument of S2.

I believe that implementing this optimization could break quite some code out
there (including CP2K) that is not standard conforming in this respect. This
should presumably not be implemented unless there is some solution for PR31447.


-- 
           Summary: use INTENT(out) for optimization
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk
 BugsThisDependsOn: 31447


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]