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/110644] Error in gfc_format_decoder
Date: Fri, 08 Mar 2024 20:32:23 +0000	[thread overview]
Message-ID: <bug-110644-4-iPniCT2GKO@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 #21 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Mar 08, 2024 at 08:01:02PM +0000, kyle.shores44 at gmail dot com wrote:
> 
> (In reply to Steve Kargl from comment #19)
> > 
> > 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
>

If shuffling the USE statements around allows your code to
compile, then it is likely that gfortran cannot tell if
there is an indirect recursion.  gfortran tries to help
the user with a warning about **possible** recursion.  There
is likely an issue with how gfortran is searching namespaces,
but  

% find . -name \*.F90 | xargs wc -l | grep total
   96683 total
% find . -name \*.f90 | xargs wc -l | grep total
    4238 total

Chopping 100 kLOC to something that is managable is beyond
what I can do.

      parent reply	other threads:[~2024-03-08 20:32 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
2024-03-08 20:32 ` 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-110644-4-iPniCT2GKO@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).