From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37BCA3888829; Wed, 30 Mar 2022 11:51:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37BCA3888829 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/105071] [9 Regression] Incorrect code with -Os and complex Date: Wed, 30 Mar 2022 11:51:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 9.5 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: Wed, 30 Mar 2022 11:51:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105071 --- Comment #5 from CVS Commits --- The releases/gcc-9 branch has been updated by Martin Jambor : https://gcc.gnu.org/g:1dc4bed43760c4e291e072aa0c8c450f5775e25f commit r9-10000-g1dc4bed43760c4e291e072aa0c8c450f5775e25f Author: Martin Jambor Date: Wed Mar 30 13:47:24 2022 +0200 cplxlower: Avoid a transform when looking at a default definition In PR 97456, IPA-SRA triggers a bug in tree-complex.c where it converts: a$_M_value_21 =3D COMPLEX_EXPR ; (where ISRA.18 is IPA-SRA created PARM_DECL with DECL_IGNORED_P set, which is why it only happens with IPA-SRA) into: a$_M_value_21 =3D COMPLEX_EXPR ; i.e. it replaces two uses of the parameter default-def with two uninitialized default-defs of a new variable - all in hope to produce code with better debug info. This patch fixes it by avoiding the transform when the SSA_NAME to be replaced is a default definition. gcc/ChangeLog: 2020-10-19 Martin Jambor PR tree-optimization/97456 PR middle-end/105071 * tree-complex.c (set_component_ssa_name): Do not replace ignor= ed decl default definitions with new component vars. Reorder if conditions. gcc/testsuite/ChangeLog: 2020-10-19 Martin Jambor PR tree-optimization/97456 * gcc.dg/tree-ssa/pr97456.c: New test. (cherry picked from commit 619f91eaa8c8a50f1f9d3e7b96ee837037f0e806)=