public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/98948] unexpected error in procedure pointer initialization or assignment with intrinsic
Date: Thu, 04 Feb 2021 00:47:15 +0000	[thread overview]
Message-ID: <bug-98948-4-MmSza4tnR7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98948-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Wed, Feb 03, 2021 at 07:00:10AM +0000, kargl at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98948
> 
> kargl at gcc dot gnu.org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Priority|P3                          |P4
>                  CC|                            |kargl at gcc dot gnu.org
> 
> --- Comment #1 from kargl at gcc dot gnu.org ---
> Confirmed, although the original code uses an extension, REAL*4.
> 
> This is a better testcase.
> 

Patch tested on original code.  Patch has not been regression tested.


diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 3b988d1be22..a6ee94216a5 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -299,6 +299,13 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag,
gfc_namespace *ns)

   if (ts->type == BT_UNKNOWN)
     {
+      /* For 'procedure(real), pointer :: ptr => abs' and 'implicit none'
+        the symbol 'abs' has an unknown type at this point and neither 
+        sym->attr.intrinsic nor sym->attr.external are set.  So just 
+        skip this symbol and hope life is good.  */
+      if (sym->attr.function || sym->attr.subroutine)
+       return true;
+
       if (error_flag && !sym->attr.untyped)
        {
          const char *guessed = lookup_symbol_fuzzy (sym->name, sym);

      parent reply	other threads:[~2021-02-04  0:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  3:37 [Bug fortran/98948] New: " xiao.liu@compiler-dev.com
2021-02-03  7:00 ` [Bug fortran/98948] " kargl at gcc dot gnu.org
2021-02-03  7:00 ` kargl at gcc dot gnu.org
2021-02-04  0:47 ` sgk at troutmask dot apl.washington.edu [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-98948-4-MmSza4tnR7@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).