From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11083 invoked by alias); 20 Jul 2010 15:06:35 -0000 Received: (qmail 9669 invoked by uid 48); 20 Jul 2010 15:06:18 -0000 Date: Tue, 20 Jul 2010 15:06:00 -0000 Message-ID: <20100720150618.9668.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43665] INTENT(IN) etc. optimization of calls: function annotations for noclobber/noescape arguments In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02084.txt.bz2 ------- 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