From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 075B2385842E; Mon, 1 Aug 2022 19:20:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 075B2385842E From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106500] New: ICE on invalid argument to c_sizeof() Date: Mon, 01 Aug 2022 19:20:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2022 19:20:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106500 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 =3D [1,2,3,4] print '(I0)', size(r), c_sizeof(real(r, c_float)) end program foo leads to=20 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=