[Bug fortran/106500] New: ICE on invalid argument to c_sizeof()

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 1 19:20:16 GMT 2022


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

            Bug ID: 106500
           Summary: ICE on invalid argument to c_sizeof()
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

This invalid program,

program foo
   use iso_c_binding
   real, allocatable :: r(:)
   allocate(r(4))
   r = [1,2,3,4]
   print '(I0)', size(r), c_sizeof(real(r, c_float))
end program foo

leads to 

troutmask:kargl[230] /home/sgk/bin/gfcx -c a.f90
f951: internal compiler error: gfc_find_array_ref(): No ref found
0x8a9dbf gfc_report_diagnostic
        ../../gccx/gcc/fortran/error.cc:883
0x8a9dbf gfc_internal_error(char const*, ...)
        ../../gccx/gcc/fortran/error.cc:1503
0x874c6f gfc_find_array_ref(gfc_expr*, bool)
        ../../gccx/gcc/fortran/array.cc:2779
0x875c12 is_c_interoperable
        ../../gccx/gcc/fortran/check.cc:5271
0x87e918 gfc_check_c_sizeof(gfc_expr*)
        ../../gccx/gcc/fortran/check.cc:5294
0x8c2c3a check_specific
        ../../gccx/gcc/fortran/intrinsic.cc:4805
0x8cb8ad gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gccx/gcc/fortran/intrinsic.cc:5042
0x92f727 resolve_unknown_f
        ../../gccx/gcc/fortran/resolve.cc:2990
0x92f727 resolve_function
        ../../gccx/gcc/fortran/resolve.cc:3347
0x92f727 gfc_resolve_expr(gfc_expr*)
        ../../gccx/gcc/fortran/resolve.cc:7187
0x9378f3 gfc_resolve_expr(gfc_expr*)
        ../../gccx/gcc/fortran/resolve.cc:7154
0x9378f3 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gccx/gcc/fortran/resolve.cc:11966
0x93af03 gfc_resolve_blocks(gfc_code*, gfc_namespace*)
        ../../gccx/gcc/fortran/resolve.cc:10965
0x937761 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gccx/gcc/fortran/resolve.cc:11956
0x93acf8 resolve_codes
        ../../gccx/gcc/fortran/resolve.cc:17609
0x93adc4 gfc_resolve(gfc_namespace*)
        ../../gccx/gcc/fortran/resolve.cc:17644
0x91a260 resolve_all_program_units
        ../../gccx/gcc/fortran/parse.cc:6604
0x91a260 gfc_parse_file()
        ../../gccx/gcc/fortran/parse.cc:6860
0x96d8c7 gfc_be_parse_file
        ../../gccx/gcc/fortran/f95-lang.cc:229


More information about the Gcc-bugs mailing list