public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kyle.shores44 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/110644] Error in gfc_format_decoder
Date: Fri, 08 Mar 2024 20:01:02 +0000	[thread overview]
Message-ID: <bug-110644-4-DuonDewQ3G@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110644-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Kyle Shores <kyle.shores44 at gmail dot com> ---
(In reply to Steve Kargl from comment #19)
> On Fri, Mar 08, 2024 at 05:42:05PM +0000, kyle.shores44 at gmail dot com
> wrote:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110644
> > 
> > --- Comment #17 from Kyle Shores <kyle.shores44 at gmail dot com> ---
> > I was able to get tuv-x to compile by putting use statements in problematic
> > files at the top of the module. In one case, I had to match the use ordering to
> > the order that the objects were used in the module (unsure if that mattered),
> > and I also removed an object in a use only statement that wasn't used in that
> > same file and then it compiled (these last two issues were for the same file
> > test/unit/radiator/from_host.F90)
> > 
> > 
> 
> It seems your code is hitting a NULL pointer dereference when
> generating a warning.  In resolve.cc(resolve_procedure_expression),
> one finds
> 
>   /* 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))
>     gfc_warning (0, "Non-RECURSIVE procedure %qs at %L is possibly calling"
> 		 " itself recursively.  Declare it RECURSIVE or use"
> 		 " %<-frecursive%>", sym->name, &expr->where);
> 
> for whatever reason &expr->where is a NULL pointer.  If I change
> the above to remove &expr->where, then your code compiles with 
> a bunch of warningsi, e.g.,
> 
> [ 95%] Building Fortran object
> test/oldtuv/CMakeFiles/oldphotolib.dir/util/la_srb.type.F90.o
> /usr/home/sgk/tmp/tuv-x/test/oldtuv/util/la_srb.type.F90:873:28:
> 
>   873 |       end module la_srb_type
>       |                            1
> Warning: Non-RECURSIVE procedure 'get_config_array' at (1) is possibly
> calling itself recursively.  Declare it RECURSIVE or use '-frecursive'
>  
> Unfortunately, without a much smaller example code, I cannot go
> any further in debugging your problem.

Well that's odd, that function doesn't call itself recursively

For example get_config_array:
https://github.com/NCAR/tuv-x/blob/6930151e3cd89189df4ec046fdf19c02300d4380/src/util/config.F90#L715-L754


Either way, this PR fixes the issue for gcc 13 be moving use statements around
https://github.com/NCAR/tuv-x/pull/53. The bug still exists in gcc 13, but for
anyone else who encounters this issue, they can try pulling use statements up
to the top of the module

  parent reply	other threads:[~2024-03-08 20:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 16:04 [Bug fortran/110644] New: " kyle.shores44 at gmail dot com
2023-07-12 17:46 ` [Bug fortran/110644] " kargl at gcc dot gnu.org
2023-10-13 19:41 ` jvdelisle at gcc dot gnu.org
2023-10-16 14:32 ` kyle.shores44 at gmail dot com
2023-10-18 15:56 ` aluaces at udc dot es
2023-10-18 17:03 ` sgk at troutmask dot apl.washington.edu
2023-10-19  8:00 ` aluaces at udc dot es
2023-10-19 15:44 ` sgk at troutmask dot apl.washington.edu
2023-10-19 16:00 ` aluaces at udc dot es
2023-10-19 16:19 ` sgk at troutmask dot apl.washington.edu
2023-10-20 15:13 ` aluaces at udc dot es
2023-10-20 17:29 ` sgk at troutmask dot apl.washington.edu
2023-10-23 15:16 ` aluaces at udc dot es
2024-03-06  3:40 ` jvdelisle at gcc dot gnu.org
2024-03-08 16:44 ` kyle.shores44 at gmail dot com
2024-03-08 16:56 ` kyle.shores44 at gmail dot com
2024-03-08 17:22 ` sgk at troutmask dot apl.washington.edu
2024-03-08 17:42 ` kyle.shores44 at gmail dot com
2024-03-08 17:42 ` kyle.shores44 at gmail dot com
2024-03-08 19:44 ` sgk at troutmask dot apl.washington.edu
2024-03-08 20:01 ` kyle.shores44 at gmail dot com [this message]
2024-03-08 20:32 ` sgk at troutmask dot apl.washington.edu

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-110644-4-DuonDewQ3G@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).