GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.
Bug 41453 - use INTENT(out) for optimization
Summary: use INTENT(out) for optimization
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on: 31447
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-23 19:00 UTC by Joost VandeVondele
Modified: 2013-03-29 09:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-03-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2009-09-23 19:00:19 UTC
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.
Comment 1 Joost VandeVondele 2012-06-29 14:25:46 UTC
still happens on  4.8 trunk
Comment 2 Joost VandeVondele 2013-03-29 09:04:29 UTC
and 4.9.0