From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30FF43877028; Mon, 2 Nov 2020 16:26:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30FF43877028 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97578] ice during IPA pass: inline Date: Mon, 02 Nov 2020 16:26:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 16:26:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97578 Martin Jambor changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jamborm at gcc dot gnu.org --- Comment #6 from Martin Jambor --- (In reply to Jan Hubicka from comment #5) > Hi, > this patch fixes the ICE, though I think we do have a design issue here > while producing debug info across ltrans boundary. >=20 > Martin, Jakub: as discussed on IRC it would be nice to add predicate > when the body is really needed and avoid materializing if it is not. > Can you add one? >=20 > Something like param_adjustemnts->need_callee_parm_decls_p () I think that in practice the existence of param_adjustemnts is by far the biggest part of the test and the patch already checks for that. A more precise check would probably be the following? /* Return true if any of the original parameters of the function has been removed or replaced. */ bool ipa_param_adjustments::orig_parameter_removed_p () { if (m_always_copy_start =3D=3D 0) return false; unsigned adj_len =3D vec_safe_length (m_adj_params); if (adj_len < m_always_copy_start) return true; unsigned i; for (i =3D 0; i < m_always_copy_start; i++) { ipa_adjusted_param *apm =3D &(*m_adj_params)[i]; if (apm->op !=3D IPA_PARAM_OP_COPY || apm->base_index !=3D i) break; } if (i =3D=3D m_always_copy_start) return false; /* In all likelihood, the ith parameter has been removed, verify. */ bool complex_case =3D false; for (unsigned j =3D i; j < adj_len; j++) { ipa_adjusted_param *apm =3D &(*m_adj_params)[j]; if (apm->op =3D=3D IPA_PARAM_OP_COPY || apm->base_index =3D=3D i) { complex_case =3D true; break; } } if (!complex_case) return true; auto_vec kept; kept.safe_grow_cleared (m_always_copy_start - i, true); for (unsigned j =3D i; j < adj_len; j++) { ipa_adjusted_param *apm =3D &(*m_adj_params)[j]; if (apm->op =3D=3D IPA_PARAM_OP_COPY) kept[apm->base_index - i] =3D true; } for (unsigned j =3D 0; j < m_always_copy_start - i; j++) if (!kept[j]) return true; return false; }=