Am 07.01.25 um 17:52 schrieb Jakub Jelinek via Gcc:
But the compiler does in every ICE message in which -freport-bug isn't
enabled.

It seems that -freport-bug does nothing for Fortran, or at least the
Fortran front end (which why it was unfamiliar to me). Grabbing a
random ICE off bugzilla, slightliy modifying it so the preprocessor
is actually invoked, one gets:

$ cat z1.F90
#define N 1

program p
   type t
      character :: a
      integer :: b
      integer :: c(t(N))
   end type
   type(t) :: z = t('a', 2, [3])
end
$ gfortran -freport-bug -c z1.F90
z1.F90:9:28:

    9 |    type(t) :: z = t('a', 2, [3])
      |                            1
Error: Bad array spec of component 'c' referenced in structure constructor at (1)
f951: internal compiler error: Segmentation fault
0x276239f internal_error(char const*, ...)
        ../../trunk/gcc/diagnostic-global-context.cc:517
0x11f33b6 crash_signal
        ../../trunk/gcc/toplev.cc:322
[...]
0xaec6d8 gfc_parse_file()
        ../../trunk/gcc/fortran/parse.cc:7368
0xb48d0f gfc_be_parse_file
        ../../trunk/gcc/fortran/f95-lang.cc:241
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

That's the bug, presumably.  I've filed PR 118336 for this.
(And mentioning -freport-bug in the docs is PR 104254, but
it is better to leave that as is because gfortran's
error message points there).

Best regards

        Thomas





Reply via email to