public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/112407] [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab
Date: Tue, 07 Nov 2023 14:25:47 +0000	[thread overview]
Message-ID: <bug-112407-4-PzivHToxEu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112407-4@http.gcc.gnu.org/bugzilla/>

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-11-07
     Ever confirmed|0                           |1

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Tomáš Trnka from comment #1)
> Created attachment 56516 [details]
> Hacky patch working around the issue on this testcase

Hi Tomáš,

'newcopyother' is determined to be recursive. The ICE arises because the line
buffer field, lb, of the expression locus is NULL (where = {nextc = 0x0, lb =
0x0}).

Compiling with -frecursive fixes the ICE in the testcase. Does that permit the
build to proceed?

This fixes the problem and is regression testing as I write.

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 81a14653a04..192a9c74b41 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -1969,6 +1969,10 @@ resolve_procedure_expression (gfc_expr* expr)
       || (sym->attr.function && sym->result == sym))
     return true;

+  /* Do not test "hidden" module symbols for recursion.  */
+  if (sym->attr.use_assoc && expr->symtree->name[0] == '@')
+    return true;
+
   /* A non-RECURSIVE procedure that is used as procedure expression within its
      own body is in danger of being called recursively.  */
   if (is_illegal_recursion (sym, gfc_current_ns))

  parent reply	other threads:[~2023-11-07 14:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 15:26 [Bug fortran/112407] New: [13 " trnka at scm dot com
2023-11-06 15:27 ` [Bug fortran/112407] " trnka at scm dot com
2023-11-07  8:34 ` [Bug fortran/112407] [13/14 " rguenth at gcc dot gnu.org
2023-11-07 14:25 ` pault at gcc dot gnu.org [this message]
2023-11-07 16:04 ` trnka at scm dot com
2023-11-08 10:51 ` pault at gcc dot gnu.org
2023-11-08 15:32 ` trnka at scm dot com
2023-11-09 14:03 ` pault at gcc dot gnu.org
2024-03-29  7:57 ` pault at gcc dot gnu.org
2024-03-29 14:10 ` pault at gcc dot gnu.org
2024-03-30  7:27 ` pault at gcc dot gnu.org
2024-04-02 13:19 ` cvs-commit at gcc dot gnu.org
2024-04-23  9:45 ` [Bug fortran/112407] [13 " pault at gcc dot gnu.org
2024-05-06  9:54 ` cvs-commit at gcc dot gnu.org
2024-05-06  9:55 ` pault at gcc dot gnu.org
2024-05-06  9:58 ` trnka at scm dot com

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-112407-4-PzivHToxEu@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).