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/103138] [12 Regression] ICE in gfc_simplify_cshift, at fortran/simplify.c:2139
Date: Mon, 08 Nov 2021 22:17:52 +0000	[thread overview]
Message-ID: <bug-103138-4-mqKvKwawhy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103138-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from anlauf at gcc dot gnu.org ---
There are more testcases also with valid code which would ICE when using
CLASS and PARAMETER, or are rejected.  See also pr103137.

Another one:

program p
  type t
  end type
  class(t), parameter :: a(2) = t()
  integer,  parameter :: c(1) = shape (a)
end

The resulting ICE can be fixed,

--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -5096,6 +5106,9 @@ gfc_check_shape (gfc_expr *source, gfc_expr *kind)
   if (source->rank == 0 || source->expr_type != EXPR_VARIABLE)
     return true;

+  if (source->ref == NULL)
+    return false;
+
   ar = gfc_find_array_ref (source);

   if (ar->as && ar->as->type == AS_ASSUMED_SIZE && ar->type == AR_FULL)

but this gives a bogus error message.

  parent reply	other threads:[~2021-11-08 22:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 18:38 [Bug fortran/103138] New: " gscfq@t-online.de
2021-11-08 20:40 ` [Bug fortran/103138] " anlauf at gcc dot gnu.org
2021-11-08 22:17 ` anlauf at gcc dot gnu.org [this message]
2021-11-09  8:33 ` [Bug fortran/103138] [12 Regression] ICE in gfc_simplify_cshift, at fortran/simplify.c:2139 since r12-4967-gbcf3728abe848888 marxin at gcc dot gnu.org
2021-11-09 11:24 ` rguenth at gcc dot gnu.org
2021-11-10 19:42 ` cvs-commit at gcc dot gnu.org
2021-11-11 20:17 ` cvs-commit at gcc dot gnu.org
2021-11-13 20:15 ` cvs-commit at gcc dot gnu.org
2022-05-06  8:31 ` [Bug fortran/103138] [12/13 " jakub at gcc dot gnu.org
2022-06-30 19:01 ` cvs-commit at gcc dot gnu.org
2022-07-03 19:44 ` cvs-commit at gcc dot gnu.org
2022-07-03 20:13 ` cvs-commit at gcc dot gnu.org
2022-07-03 20:29 ` cvs-commit at gcc dot gnu.org
2022-07-03 20:31 ` anlauf 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-103138-4-mqKvKwawhy@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).