public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/105310] New: ICE when UNION is after the 8th field in a DEC STRUCTURE with -finit-derived -finit-local-zero
@ 2022-04-19 15:34 foreese at gcc dot gnu.org
  2022-04-19 16:07 ` [Bug fortran/105310] " foreese at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: foreese at gcc dot gnu.org @ 2022-04-19 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105310
           Summary: ICE when UNION is after the 8th field in a DEC
                    STRUCTURE with -finit-derived -finit-local-zero
           Product: gcc
           Version: 7.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: foreese at gcc dot gnu.org
  Target Milestone: ---

Created attachment 52833
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52833&action=edit
Test case exhibiting the ICE

Consider:

$ cat testunion.for
      PROGRAM TESTU
        IMPLICIT NONE
        STRUCTURE /FOO/
          INTEGER(4) :: a,b,c,d,e,f,g,h
          UNION
          MAP
          ENDMAP
          ENDUNION
        ENDSTRUCTURE
        RECORD /FOO/ bar
        bar.a = 1
      END

$ gfortran -O0 -c -ffixed-form -finit-local-zero -finit-derived -fdec-structure
testunion.for
testunion.for:15:0:

       end

internal compiler error: Segmentation fault
0xa72a2f crash_signal
        /data/gcc-7.4.0/gcc/toplev.c:337
0xcb6a54 compute_reloc_for_constant(tree_node*)
        /data/gcc-7.4.0/gcc/varasm.c:4120
0xcb6b5c compute_reloc_for_constant(tree_node*)
        /data/gcc-7.4.0/gcc/varasm.c:4174
0xcbc802 get_variable_section(tree_node*, bool)
        /data/gcc-7.4.0/gcc/varasm.c:1148
0xcc0cb7 assemble_variable(tree_node*, int, int, int)
        /data/gcc-7.4.0/gcc/varasm.c:2225
0xcc4ce2 varpool_node::assemble_decl()
        /data/gcc-7.4.0/gcc/varpool.c:588
0x7426fc output_in_order
        /data/gcc-7.4.0/gcc/cgraphunit.c:2289
0x742ac3 symbol_table::compile()
        /data/gcc-7.4.0/gcc/cgraphunit.c:2530
0x744b16 symbol_table::compile()
        /data/gcc-7.4.0/gcc/cgraphunit.c:2629
0x744b16 symbol_table::finalize_compilation_unit()
        /data/gcc-7.4.0/gcc/cgraphunit.c:2626
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


ICE occurs with 7.4 and higher, where the -fdec-structure and -finit-derived
options were introduced.

The ICE occurs at -O0 but not for higher optimization levels. The ICE occurs
only when there are (8*2^n) fields preceding the union, regardless of which
fields are in the union.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-21 14:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 15:34 [Bug fortran/105310] New: ICE when UNION is after the 8th field in a DEC STRUCTURE with -finit-derived -finit-local-zero foreese at gcc dot gnu.org
2022-04-19 16:07 ` [Bug fortran/105310] " foreese at gcc dot gnu.org
2022-04-20  7:20 ` rguenth at gcc dot gnu.org
2022-04-21 14:15 ` cvs-commit at gcc dot gnu.org
2022-04-21 14:26 ` cvs-commit at gcc dot gnu.org
2022-04-21 14:42 ` cvs-commit at gcc dot gnu.org
2022-04-21 14:51 ` cvs-commit at gcc dot gnu.org

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).