From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1D48382DA4E; Fri, 26 Aug 2022 07:29:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1D48382DA4E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661498992; bh=niHBfyE1s4whpYD/yHZKhbKPcBERj9Y6jEhcuPyR1Mw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oLiZWvl/mf/2U21R9TQLMy6dATn+o95vt79mf/SyMYln+mgZlsycl/mMEbn79VGpF MRIj9Y0bfMqcv4HV9r0nZUrfccCaSVkeU3UuJ92O+3tF/BMu+wVDWljv1ZyeNFRo0W 907Tq+1HSY1S7egEvrKiTOMA3l+KdPj8mCo/6yKM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106099] [13 Regression] ICE in execute_todo, at passes.cc:2134 since r13-1204-gd68d366425369649 Date: Fri, 26 Aug 2022 07:29:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub 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=3D106099 --- Comment #15 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:530dc5aaaeb67c223fd0e3986d635408dcea4343 commit r13-2213-g530dc5aaaeb67c223fd0e3986d635408dcea4343 Author: Jakub Jelinek Date: Fri Aug 26 09:28:48 2022 +0200 internal-fn, tree-cfg: Fix .TRAP handling and another __builtin_trap vo= ps issue [PR106099] This patch fixes 2 __builtin_unreachable/__builtin_trap related issues. One (first hunk) is that CDDCE happily removes calls to .TRAP () internal-fn as useless. The problem is that the internal-fn is ECF_CONST | ECF_NORETURN, doesn't have lhs and so DCE thinks it doesn't have side-effects and removes it. __builtin_unreachable which has the same ECF_* flags works fine, as since PR44485 we implicitly add ECF_LOOPING_CONST_OR_PURE to ECF_CONST | ECF_NORETURN builtins, but do it in flags_from_decl_or_type which isn't called for internal-fns. As IFN_TRAP is the only ifn with such flags, it seems easier to add it explicitly. The other issue (which on the testcase can be seen only with the first bug unfixed) is that execute_fixup_cfg can add a __builtin_trap which needs vops, but nothing adds it and it can appear in many passes which don't have corresponding TODO_update_ssa_only_virtuals etc. Fixed similarly as last time but emitting ifn there instead. 2022-08-26 Jakub Jelinek PR tree-optimization/106099 * internal-fn.def (TRAP): Add ECF_LOOPING_CONST_OR_PURE flag. * tree-cfg.cc (execute_fixup_cfg): Add IFN_TRAP instead of __builtin_trap to avoid the need of vops. * gcc.dg/pr106099.c: New test.=