public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/66969] Internal compiler error, segmentation fault
Date: Sun, 15 Oct 2023 20:23:09 +0000	[thread overview]
Message-ID: <bug-66969-4-VbeWNsZ0cj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66969-4@http.gcc.gnu.org/bugzilla/>

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org
           Keywords|                            |accepts-invalid

--- Comment #4 from anlauf at gcc dot gnu.org ---
We might need to tighten the check of restricted expressions:

diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index 663fe63dea6..6996e1e93d1 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -2849,6 +2852,21 @@ check_inquiry (gfc_expr *e, int not_restricted)
          && ap->expr->expr_type == EXPR_VARIABLE
          && asym->attr.dummy && asym->attr.optional)
        return MATCH_NO;
+
+      if (not_restricted == 0
+         && ap->expr->expr_type == EXPR_VARIABLE
+         && !(asym->attr.flavor == FL_PARAMETER)
+         && !asym->attr.dummy
+         && !asym->attr.in_common
+         && !asym->attr.use_assoc
+         && !asym->attr.host_assoc
+         && !asym->attr.implied_index
+         && (asym->attr.allocatable
+             || asym->attr.pointer
+             || (asym->as && asym->as->type == AS_DEFERRED)))
+       {
+         return MATCH_ERROR;
+       }
     }

   return MATCH_YES;


This needs to be refined further.

      parent reply	other threads:[~2023-10-15 20:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-66969-4@http.gcc.gnu.org/bugzilla/>
2015-08-30 13:36 ` dominiq at lps dot ens.fr
2015-10-02 22:01 ` kargl at gcc dot gnu.org
2023-10-12 20:39 ` anlauf at gcc dot gnu.org
2023-10-15 20:23 ` anlauf at gcc dot gnu.org [this message]

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-66969-4-VbeWNsZ0cj@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).