Checked for existing upstream reports, and reduced the ICE to a minimal
reproducer.

Minimal reproducer (gfortran-15 15.3.0-4ubuntu1 and gfortran-16
16.2.0-3ubuntu1 on stonking amd64):

$ cat m.f90
module m
  interface
    module function g() result(n)
      integer :: n
    end function
  end interface
  abstract interface
    function f() result(n)
      integer :: n
    end function
  end interface
  procedure(f), pointer :: p
end module m

$ cat s.f90
submodule(m) s
contains
  module procedure g
    n = 0
    if (associated(p)) n = 1
  end procedure
end submodule s

$ gfortran -c m.f90 && gfortran -c -flto s.f90
s.f90:6:15: internal compiler error: in write_symbol, at 
lto-streamer-out.cc:3086   (GCC 16: line 3096)

 * Trigger: referencing a module-level procedure pointer variable (here just 
associated(p); calling p() also triggers it) from within a submodule, compiled 
with -flto (any -O level).
 * The same reference from a separate module that USEs m works, and so does the 
submodule if it doesn't reference p, or without -flto.
 * In fortran-julienne this is julienne_multi_image_s.F90, built with 
-DJULIENNE_PARALLEL_CALLBACKS=1 (the julienne_this_image/... procedure 
pointers).

Existing upstream reports: GCC's bugzilla isn't reachable from here (bot 
protection), so I searched the [email protected] archive. Nothing matches 
this case:
 * PR126170 (July 2026, fixed on master as r17-2332, "Fix LTO ICE in 
copy_function_or_variable"): another gfortran LTO ICE, caused by a duplicated 
derived-type vtab symbol from a redundant USE; different symbol and trigger. 
Its regression PR126210 is about that fix.
 * PR82586 / PR71861 ("ICE in write_symbol(): bad module symbol"): these are 
module-file write_symbol in gcc/fortran/module.cc, not lto-streamer-out.cc.
 * PR93158 / PR93424 / PR99798 (submodule ICEs): different paths, no LTO.

So, as far as can be checked from here, this looks unreported. Someone
with bugzilla access should search for "write_symbol lto-streamer-out"
and then file a new PR (component fortran or lto) with the reproducer
above, mentioning GCC 15.3.0 and 16.2.0.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169866

Title:
  fortran-julienne 4.1.0-1 FTBFS: gfortran ICE in write_symbol (lto-
  streamer-out.cc:3086) with LTO

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fortran-julienne/+bug/2169866/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to