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

            Bug ID: 94030
           Summary: ICE equivalence of an integer and an element of an
                    array of size n
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markeggleston at gcc dot gnu.org
  Target Milestone: ---

subroutine f(n)
  integer :: n
  integer :: arr(n)
  integer :: i
  equivalence (i, arr(1))
end

Using 9.2 release:

f951: internal compiler error: get_mpz(): Not an integer constant
0x657561 gfc_internal_error(char const*, ...)
        ../../gcc/gcc/fortran/error.c:1363
0x717f1b get_mpz
        ../../gcc/gcc/fortran/trans-common.c:782
0x717f1b element_number
        ../../gcc/gcc/fortran/trans-common.c:813
0x717f1b calculate_offset
        ../../gcc/gcc/fortran/trans-common.c:871
0x7180fa new_condition
        ../../gcc/gcc/fortran/trans-common.c:905
0x7180fa add_condition
        ../../gcc/gcc/fortran/trans-common.c:946
0x7180fa find_equivalence
        ../../gcc/gcc/fortran/trans-common.c:989
0x7180fa add_equivalences
        ../../gcc/gcc/fortran/trans-common.c:1022
0x719887 finish_equivalences
        ../../gcc/gcc/fortran/trans-common.c:1229
0x719887 gfc_trans_common(gfc_namespace*)
        ../../gcc/gcc/fortran/trans-common.c:1297
0x7242af gfc_generate_function_code(gfc_namespace*)
        ../../gcc/gcc/fortran/trans-decl.c:6670
0x6b24b0 translate_all_program_units
        ../../gcc/gcc/fortran/parse.c:6134
0x6b24b0 gfc_parse_file()
        ../../gcc/gcc/fortran/parse.c:6367
0x6fbe3f gfc_be_parse_file
        ../../gcc/gcc/fortran/f95-lang.c:204
Please submit a full bug report,

Version info for compiler:
Using built-in specs.
COLLECT_GCC=/home/markeggleston/t3/install-gcc/release-9.2/bin/gfortran
COLLECT_LTO_WRAPPER=/home/markeggleston/t3/install-gcc/release-9.2/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/release-9.2
--enable-languages=fortran --disable-nls --disable-bootstrap
Thread model: posix
gcc version 9.2.0 (GCC) 

Also occurs with builds of 8.1, 8.2, 8.3, 9.1 and the Debian built compiler GNU
Fortran (Debian 6.3.0-18+deb9u1) 6.3.0 20170516

Reply via email to