From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3CEA03858D3C; Wed, 1 Mar 2023 16:50:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CEA03858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677689404; bh=3mJh+LcSvDnTnDCerYnR8UtBBIIu07eF3vZV/0zTc2g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qfsaRp6tZl4aOlLsk60QpG9gnQNjnn6NGhLxhImQ6fBBSoYzour/b9X1jZD2Dx/qA zJjUx50ACwtx8si5j0DQy8auFixrrxBNj2S66AOmTQPJ1QC/qsxvLZ+EnO2BA2oQdu irsfGxSeBW87ICWEWKNOt1EO15gDWPDcU4C3yOak= From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/108959] [13 Regression] ice in modify_assignment, at ipa-param-manipulation.cc:1905 since r13-5681-ge8109bd87766be Date: Wed, 01 Mar 2023 16:50:04 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108959 --- Comment #7 from Martin Jambor --- The situation is that in func_61 we have an unused parameter which IPA-SRA wants to remove. It's caller constructs the unused parameter with the following sequence (shortened): int func_43 (int * p_44) { int _1; _1 =3D *p_44_3(D); func_61 (_1); } Caller of func_43 however stores a long at that address and this is what IPA-CP wants to pass down, while IPA-SRA knows that p_44 is used only to create an argument for an unused formal parameter and would like to remove both. This means that the code in ipa-param-manipulation.cc kicks in, trying to replace loads from the disappearing parameter with known constants because once the parameter is gone there this can no longer be done. But it attempts to create an invalid VIEW_CONVERT_EXPR in the process. The simplest way of avoiding it is to disable the removal of the parameter in these situations too extending the patch from e8109bd8776 with: diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc index 3de7d426b7e..e9c47c0d852 100644 --- a/gcc/ipa-sra.cc +++ b/gcc/ipa-sra.cc @@ -4235,6 +4235,7 @@ adjust_parameter_descriptions (cgraph_node *node, isra_func_summary *ifs) !=3D pa->unit_size)) { desc->split_candidate =3D false; + desc->locally_unused =3D false; if (dump_file && (dump_flags & TDF_DETAILS)) dump_dead_indices.safe_push (i); break; But since this is all code that will be eliminated anyway, perhaps we could be aggressive here and use force_value_to_type from tree-inline.cc?=