From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A8963858D35; Tue, 1 Feb 2022 09:49:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A8963858D35 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/104321] Dead code since r12-4467-g64f9623765da33 Date: Tue, 01 Feb 2022 09:49:19 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Tue, 01 Feb 2022 09:49:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104321 --- Comment #1 from Tobias Burnus --- I think it is not only dead code but it should be also removed: Glancing at the code, the 'data =3D NULL;' does not make sense (cf. 'memcpy= (lhs, rhs)' above, lhs is data+offset) =E2=80=93 and also does not match the comm= ent. Besides, all testcases seem to be happy with that line being dead code Thus, I think the following is the right solution: diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index 6493cc2f6b1..45ba440c1db 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -7107,5 +7107,2 @@ gfc_conv_cfi_to_gfc (stmtblock_t *init, stmtblock_t *finally, /* if (cond) { block2 } */ - tmp =3D fold_build2_loc (input_location, MODIFY_EXPR, void_type_node, - data, fold_convert (TREE_TYPE (data), - null_pointer_node)); tmp =3D build3_v (COND_EXPR, cond_var, gfc_finish_block (&block2),=