From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0BCC4385084E; Mon, 20 Mar 2023 08:34:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BCC4385084E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679301264; bh=L+cjHDeqvLMubChn4bpNy6ijZR54vANOw/jOsIJt/K4=; h=From:To:Subject:Date:From; b=iBdR2cLAo4fnvqixuJAXlrtQwmcUB2dwU2mDBY6BgWDrFfP4Frv7CitrtCmtQt18A 7ASIs7+8uAmvGAVlBj9bL6hu5EwJ9whGX5kpk44riKfWd4YElkr+JMOASBFl6arhmK x041jc9HNvvhybZMR8rw5LvsEx9DuYPH9K2IlJ7U= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109206] New: [13 Regression] gcc/fortran/class.cc:2768:14: runtime error: load of value 4139789424, which is not a valid value for type 'bt' since r13-6747-gd7caf313525a46 Date: Mon, 20 Mar 2023 08:34:15 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin 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 cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109206 Bug ID: 109206 Summary: [13 Regression] gcc/fortran/class.cc:2768:14: runtime error: load of value 4139789424, which is not a valid value for type 'bt' since r13-6747-gd7caf313525a46 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: pault at gcc dot gnu.org Target Milestone: --- The following test-case fails with UBSAN enabled: $ cat finalize_38a.f90 module testmode type simple integer ind end type=20 type, extends(simple) :: complicated real rind contains final destructor4 end type=20 contains subroutine destructor4(self) type(complicated) self end=20=20 function constructor2(rind) optional rind type(complicated), allocatable :: src(:) integer sz if (present (rind)) then src =3D [(complicated (ind0, rind0), i =3D 1, sz)]=20=20=20 end if end=20=20 end $ /dev/shm/objdir2/gcc/xgcc -B/dev/shm/objdir2/gcc/ finalize_38a.f90 -c -std=3Df2008 finalize_38a.f90:19:56: 19 | src =3D [(complicated (ind0, rind0), i =3D 1, sz)] | 1 Warning: The structure constructor at (1) has been finalized. This feature = was removed by f08/0011. Use -std=3Df2018 or -std=3Dgnu to eliminate the finali= zation. /home/marxin/Programming/gcc/gcc/fortran/class.cc:2768:14: runtime error: l= oad of value 4139789424, which is not a valid value for type 'bt' #0 0xab7ec1 in gfc_may_be_finalized(gfc_typespec) /home/marxin/Programming/gcc/gcc/fortran/class.cc:2768 #1 0xed949d in gfc_trans_array_constructor_value /home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:2309 #2 0xede7b7 in trans_array_constructor /home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:2936 #3 0xee0956 in gfc_add_loop_ss_code /home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:3229 #4 0xef7ce6 in gfc_conv_loop_setup(gfc_loopinfo*, locus*) /home/marxin/Programming/gcc/gcc/fortran/trans-array.cc:5526 #5 0x10270a6 in gfc_trans_assignment_1 /home/marxin/Programming/gcc/gcc/fortran/trans-expr.cc:11789 #6 0x102a9e2 in gfc_trans_assignment(gfc_expr*, gfc_expr*, bool, bool, bool, bool) /home/marxin/Programming/gcc/gcc/fortran/trans-expr.cc:12251 #7 0x102ab73 in gfc_trans_assign(gfc_code*) /home/marxin/Programming/gcc/gcc/fortran/trans-expr.cc:12264 #8 0xec3f1b in trans_code /home/marxin/Programming/gcc/gcc/fortran/trans.cc:2229 #9 0xec497c in gfc_trans_code(gfc_code*) /home/marxin/Programming/gcc/gcc/fortran/trans.cc:2582 #10 0x110ae45 in gfc_trans_if_1 /home/marxin/Programming/gcc/gcc/fortran/trans-stmt.cc:1487 #11 0x110b1bf in gfc_trans_if(gfc_code*) /home/marxin/Programming/gcc/gcc/fortran/trans-stmt.cc:1519 #12 0xec42e3 in trans_code /home/marxin/Programming/gcc/gcc/fortran/trans.cc:2317 #13 0xec497c in gfc_trans_code(gfc_code*) /home/marxin/Programming/gcc/gcc/fortran/trans.cc:2582 #14 0xfa0df6 in gfc_generate_function_code(gfc_namespace*) /home/marxin/Programming/gcc/gcc/fortran/trans-decl.cc:7714 #15 0xec55d8 in gfc_generate_module_code(gfc_namespace*) /home/marxin/Programming/gcc/gcc/fortran/trans.cc:2649 #16 0xcff92f in translate_all_program_units /home/marxin/Programming/gcc/gcc/fortran/parse.cc:6707 #17 0xd00f09 in gfc_parse_file() /home/marxin/Programming/gcc/gcc/fortran/parse.cc:7026 #18 0xe822bb in gfc_be_parse_file /home/marxin/Programming/gcc/gcc/fortran/f95-lang.cc:229 #19 0x278e9f1 in compile_file /home/marxin/Programming/gcc/gcc/toplev.cc:444 #20 0x2796c4b in do_compile /home/marxin/Programming/gcc/gcc/toplev.cc:= 2125 #21 0x27974c1 in toplev::main(int, char**) /home/marxin/Programming/gcc/gcc/toplev.cc:2277 #22 0x69f084d in main /home/marxin/Programming/gcc/gcc/main.cc:39 #23 0x7ffff722caef in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #24 0x7ffff722cbb8 in __libc_start_main_impl ../csu/libc-start.c:360 #25 0xa3c164 in _start ../sysdeps/x86_64/start.S:115=