public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/66045] ICE on incorrect code with null
Date: Thu, 07 May 2015 15:18:00 -0000	[thread overview]
Message-ID: <bug-66045-4-2TmAKWbWP3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66045-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66045

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-05-07
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
Confirmed.

This patch (watch copy-n-paste tab corruption)

Index: expr.c
===================================================================
--- expr.c      (revision 222869)
+++ expr.c      (working copy)
@@ -3118,19 +3118,22 @@ gfc_check_assign (gfc_expr *lvalue, gfc_
        bad_proc = true;

       /* (ii) The assignment is in the main program; or  */
-      if (gfc_current_ns->proc_name->attr.is_main_program)
+      if (gfc_current_ns->proc_name
+         && gfc_current_ns->proc_name->attr.is_main_program)
        bad_proc = true;

       /* (iii) A module or internal procedure...  */
-      if ((gfc_current_ns->proc_name->attr.proc == PROC_INTERNAL
-          || gfc_current_ns->proc_name->attr.proc == PROC_MODULE)
+      if (gfc_current_ns->proc_name
+         && (gfc_current_ns->proc_name->attr.proc == PROC_INTERNAL
+             || gfc_current_ns->proc_name->attr.proc == PROC_MODULE)
          && gfc_current_ns->parent
          && (!(gfc_current_ns->parent->proc_name->attr.function
                || gfc_current_ns->parent->proc_name->attr.subroutine)
              || gfc_current_ns->parent->proc_name->attr.is_main_program))
        {
          /* ... that is not a function...  */
-         if (!gfc_current_ns->proc_name->attr.function)
+         if (gfc_current_ns->proc_name
+             && !gfc_current_ns->proc_name->attr.function)
            bad_proc = true;

          /* ... or is not an entry and has a different name.  */

yields

gfc6 -c po.f90
po.f90:3:19:

    integer :: null=null()
                   1
Error: NULL appears on right-hand side in assignment at (1)


  reply	other threads:[~2015-05-07 15:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07  7:59 [Bug fortran/66045] New: " gerhard.steinmetz.fortran@t-online.de
2015-05-07 15:18 ` kargl at gcc dot gnu.org [this message]
2015-05-18 22:21 ` [Bug fortran/66045] " kargl at gcc dot gnu.org
2015-05-19 18:03 ` kargl at gcc dot gnu.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=bug-66045-4-2TmAKWbWP3@http.gcc.gnu.org/bugzilla/ \
    --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).