[Bug fortran/110644] Error in gfc_format_decoder
sgk at troutmask dot apl.washington.edu
gcc-bugzilla@gcc.gnu.org
Fri Mar 8 19:44:12 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110644
--- Comment #19 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
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.
More information about the Gcc-bugs
mailing list