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:06:18 -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 #7 from burnus at gcc dot gnu dot org 2010-07-20 15:06 -------
Created an attachment (id=21265)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21265&action=view)
Draft patch for external/user procs with INTENT (mostly OK, but breaks existing
test)
The attached patch mostly works, except for
gfortran.dg/allocatable_scalar_4.f90.
The latter file works fine with -O1 but with -O2 it crashes. At -O1 with
-fdump-tree-original, essentially only one "if" is optimized away:
b = 7482
call checkOptional(.false.,.true., 7482)
if (b /= 7482) call abort() ! <<<< This line is removed for -O1
call checkOptional(.true., .true., 7482, b)
I could not see anything suspicious for -O{2,1} -fdump-tree-optimized; one
should check -fdump-tree-optimized-all. I somehow have the feeling that some
other DECL is wrong. Cf. PR 44945 for another manifestation of DECL problems
(though there for derived types).
Note: Using -fwhole-file does not help.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43665