From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6801 invoked by alias); 1 Mar 2006 12:36:12 -0000 Received: (qmail 6769 invoked by uid 48); 1 Mar 2006 12:36:08 -0000 Date: Wed, 01 Mar 2006 12:36:00 -0000 Message-ID: <20060301123608.6768.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/26107] ICE after error message on invalid code In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "paul dot richard dot thomas at cea dot fr" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-03/txt/msg00071.txt.bz2 List-Id: ------- Comment #2 from paul dot richard dot thomas at cea dot fr 2006-03-01 12:36 ------- This fixes it: Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (révision 111471) +++ gcc/fortran/resolve.c (copie de travail) @@ -1357,7 +1357,7 @@ need_full_assumed_size = temp; - if (!pure_function (expr, &name)) + if (!pure_function (expr, &name) && name) { if (forall_flag) and this tests it: ! { dg-do compile } ! Tests fix for PR26107 in which an ICE would occur after the second ! error message below. This resulted from a spurious attempt to ! produce the third error message, without the name of the function. ! ! This is an expanded version of the testcase in the PR. ! pure function equals(self, & ! { dg-error "must be INTENT(IN)" } string, ignore_case) result(same) character(*), intent(in) :: string integer(4), intent(in) :: ignore_case integer(4) :: same if (len (self) < 1) return ! { dg-error "Type of argument" } same = 1 end function function impure(self) result(ival) character(*), intent(in) :: self ival = 1 end function pure function purity(self, string, ignore_case) result(same) character(*), intent(in) :: self character(*), intent(in) :: string integer(4), intent(in) :: ignore_case integer i if (end > impure (self)) & ! { dg-error "non-PURE procedure" } return end function Will post to the list tonight. Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26107