From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AC683840C19; Mon, 2 Nov 2020 14:51:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AC683840C19 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97652] [11 Regression] New gfortran.dg/pdt_14.f03 failure after g:617695cdc2b3d950f1e4deb5ea85d5cc302943f4 Date: Mon, 02 Nov 2020 14:51:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component Message-ID: In-Reply-To: References: 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, 02 Nov 2020 14:51:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97652 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ipa |fortran --- Comment #11 from Richard Biener --- push_8 argument type is arguments unsigned DI size unit-size align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-ty= pe 0x7ffff69ec000> readonly used unsigned DI passed-by-reference /home/rguenther/src/gcc2/gcc/testsuite/gfortran.dg/pdt_14.f03:47:0 size unit-size align:64 warn_if_not_align:0 context arg-type > (gdb) p debug_tree (0x7ffff69e3000) unit-size align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff69dcf18 and in ch2701 the root variable is var_decl 0x7ffff69f6900 root type addressable used unsigned DI /home/rguenther/src/gcc2/gcc/testsuite/gfortran.dg/pdt_14.f03:78:48 size unit-size align:64 warn_if_not_align:0 context > (gdb) p debug_tree (0x7ffff69fb0a8) unit-size align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff69fb2a0 which is a different type. The latter is created here: #0 0x0000000000c1d6f2 in gfc_get_derived_type (derived=3D0x39ebb70, codime= n=3D0) at /home/rguenther/src/gcc2/gcc/fortran/trans-types.c:2647 #1 0x0000000000c18c21 in gfc_typenode_for_spec (spec=3D0x39eb090, codim=3D= 0) at /home/rguenther/src/gcc2/gcc/fortran/trans-types.c:1167 #2 0x0000000000c1c54b in gfc_sym_type (sym=3D0x39eb070) at /home/rguenther/src/gcc2/gcc/fortran/trans-types.c:2252 #3 0x0000000000b701d9 in gfc_get_symbol_decl (sym=3D0x39eb070) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:1790 #4 0x0000000000b7fe7f in generate_local_decl (sym=3D0x39eb070) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:5948 #5 0x0000000000b1843d in do_traverse_symtree (st=3D0x39ec880, st_func=3D0x= 0,=20 sym_func=3D0xb7fdbb ) at /home/rguenther/src/gcc2/gcc/fortran/symbol.c:4170 #6 0x0000000000b184f8 in gfc_traverse_ns (ns=3D0x3a2f6d0,=20 sym_func=3D0xb7fdbb ) at /home/rguenther/src/gcc2/gcc/fortran/symbol.c:4195 #7 0x0000000000b80677 in generate_local_vars (ns=3D0x3a2f6d0) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:6154 #8 0x0000000000b825af in gfc_generate_function_code (ns=3D0x3a2f6d0) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:6812 #9 0x0000000000b3e3fe in gfc_generate_code (ns=3D0x3a2f6d0) at /home/rguenther/src/gcc2/gcc/fortran/trans.c:2235 #10 0x0000000000abe7e0 in translate_all_program_units ( gfc_global_ns_list=3D0x39b18f0) while the former here: #0 0x0000000000c1d6f2 in gfc_get_derived_type (derived=3D0x39c6480, codime= n=3D0) at /home/rguenther/src/gcc2/gcc/fortran/trans-types.c:2647 #1 0x0000000000c18c21 in gfc_typenode_for_spec (spec=3D0x39ce5a0, codim=3D= 0) at /home/rguenther/src/gcc2/gcc/fortran/trans-types.c:1167 #2 0x0000000000c1c54b in gfc_sym_type (sym=3D0x39ce580) at /home/rguenther/src/gcc2/gcc/fortran/trans-types.c:2252 #3 0x0000000000b701d9 in gfc_get_symbol_decl (sym=3D0x39ce580) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:1790 #4 0x0000000000b7dd72 in gfc_create_module_variable (sym=3D0x39ce580) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:5339 #5 0x0000000000b1843d in do_traverse_symtree (st=3D0x3951a30, st_func=3D0x= 0,=20 sym_func=3D0xb7d65d ) at /home/rguenther/src/gcc2/gcc/fortran/symbol.c:4170 #6 0x0000000000b184f8 in gfc_traverse_ns (ns=3D0x39b2f80,=20 sym_func=3D0xb7d65d ) at /home/rguenther/src/gcc2/gcc/fortran/symbol.c:4195 #7 0x0000000000b7fb05 in gfc_generate_module_vars (ns=3D0x39b2f80) at /home/rguenther/src/gcc2/gcc/fortran/trans-decl.c:5838 #8 0x0000000000b3e4f4 in gfc_generate_module_code (ns=3D0x39b2f80) at /home/rguenther/src/gcc2/gcc/fortran/trans.c:2259 #9 0x0000000000abe712 in translate_all_program_units ( gfc_global_ns_list=3D0x39b18f0) there is it seems code to deal with the type already been there but it seems this handling doesn't work. It does /* Store up the canonical type to be added to this one. */ if (got_canonical) { if (TYPE_CANONICAL (derived->backend_decl)) canonical =3D TYPE_CANONICAL (derived->backend_decl); else canonical =3D derived->backend_decl; derived->backend_decl =3D NULL_TREE; } /* derived->backend_decl !=3D 0 means we saw it before, but its components' backend_decl may have not been built. */ if (derived->backend_decl) ... else { /* We see this derived type first time, so build the type node. */ typenode =3D make_node (RECORD_TYPE); TYPE_NAME (typenode) =3D get_identifier (derived->name); TYPE_PACKED (typenode) =3D flag_pack_derived; derived->backend_decl =3D typenode; } but we enver find a canonical type. Looks like a latent issue exposed now.=