From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70EB43858D1E; Mon, 24 Apr 2023 12:57:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70EB43858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682341062; bh=TsQFAykwrEk07TQ3xYS+Pmp1NE0iZTjADnwDFzmTBzY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kZ6NOBAWS4tJ1pVqVi4f4bhXuTAlG+Myo/bfevcKEfKxFZOkWOyWuUvfNppab4l/l 67U9oPsi2x3RTYCvIWGaRgiTiQDzzetJJoQ2IZIGWNsxSalmThKL6zdXf+URdQg4ok BSOLfEj+B63aqvcuL2JMUnJEM5nOYf0fpOEl5ywc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/109607] IPA replaces stmt with invalid gimple Date: Mon, 24 Apr 2023 12:57:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on assigned_to bug_status everconfirmed 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109607 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-04-24 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- #0 ipa_param_body_adjustments::modify_expression (this=3D0x4b1f040,=20 expr_p=3D0x7ffff37222b8, convert=3Dtrue) at /space/rguenther/src/gcc/gcc/ipa-param-manipulation.cc:1867 #1 0x00000000016f7dc5 in ipa_param_body_adjustments::modify_assignment ( this=3D0x4b1f040, stmt=3D,=20 extra_stmts=3D0x7fffffffd0a8) at /space/rguenther/src/gcc/gcc/ipa-param-manipulation.cc:1890 #2 0x00000000016f927a in ipa_param_body_adjustments::modify_gimple_stmt ( this=3D0x4b1f040, stmt=3D0x7fffffffd168, extra_stmts=3D0x7fffffffd0a8,= =20 orig_stmt=3D) at /space/rguenther/src/gcc/gcc/ipa-param-manipulation.cc:2273 #3 0x0000000001abb925 in remap_gimple_stmt ( stmt=3D, id=3D0x7fffffffd730) at /space/rguenther/src/gcc/gcc/tree-inline.cc:1961 Supposedly the easiest would be to make any is_gimple_reg_type IPA SRA replacement (I suppose all are ...) either address-taken or DECL_NOT_GIMPLE_REG_P. diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc index 42488ee09c3..473d759f983 100644 --- a/gcc/ipa-param-manipulation.cc +++ b/gcc/ipa-param-manipulation.cc @@ -1384,6 +1384,8 @@ ipa_param_body_adjustments::common_initialization (tr= ee old_fndecl, DECL_CONTEXT (new_parm) =3D m_fndecl; TREE_USED (new_parm) =3D 1; DECL_IGNORED_P (new_parm) =3D 1; + if (is_gimple_reg_type (new_type)) + DECL_NOT_GIMPLE_REG_P (new_parm) =3D 1; layout_decl (new_parm, 0); m_new_decls.quick_push (new_parm); seems to work on the testcase I have.=