This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/43665] INTENT(IN) etc. optimization of calls: function annotations for noclobber/noescape arguments
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jul 2010 15:58:07 -0000
- Subject: [Bug fortran/43665] INTENT(IN) etc. optimization of calls: function annotations for noclobber/noescape arguments
- References: <bug-43665-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from burnus at gcc dot gnu dot org 2010-07-20 15:58 -------
The procedure 'checkoptional' gets '.rrrw' set as the fn spec.
With -O1, the if after the first "checkoptional" gets properly optimized away
(cf. comment 7 and original test case).
With -O2, the number of arguments is reduced to one (NULL vs. &b) and the
condition
if (b /= 46) error stop 1
is changed to
error stop 1
(cf. -fdump-tree-optimized)
For me it looks as if the "fn spec" information is not moved along when
arguments are eliminated but remain at the previous position. It works if one
swaps the order (i.e. it works if the optional argument is at position one).
Richard, does this make sense or am I completely off track?
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43665