public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paul dot richard dot thomas at cea dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/26107] ICE after error message on invalid code
Date: Wed, 01 Mar 2006 12:36:00 -0000	[thread overview]
Message-ID: <20060301123608.6768.qmail@sourceware.org> (raw)
In-Reply-To: <bug-26107-6528@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1675 bytes --]



------- 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


  parent reply	other threads:[~2006-03-01 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-05 17:47 [Bug fortran/26107] New: " pinskia at gcc dot gnu dot org
2006-02-06  9:34 ` [Bug fortran/26107] " reichelt at gcc dot gnu dot org
2006-03-01 12:36 ` paul dot richard dot thomas at cea dot fr [this message]
2006-03-03  5:50 ` patchapp at dberlin dot org
2006-03-06 22:56 ` pault at gcc dot gnu dot org
2006-03-06 23:03 ` pault at gcc dot gnu dot org
2006-03-07  0:07 ` pault at gcc dot gnu dot org
2006-03-07  2:25 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060301123608.6768.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).