From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81262385800F; Sun, 12 Dec 2021 10:38:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81262385800F From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103665] insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations Date: Sun, 12 Dec 2021 10:38:54 +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: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Sun, 12 Dec 2021 10:38:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103665 --- Comment #1 from CVS Commits --- The master branch has been updated by Jan Hubicka : https://gcc.gnu.org/g:e93809f62363ba4b233858005aef652fb550e896 commit r12-5915-ge93809f62363ba4b233858005aef652fb550e896 Author: Jan Hubicka Date: Sun Dec 12 11:38:13 2021 +0100 Terminate BB analysis on NULL memory access in ipa-pure-const and ipa-modref As discussed in the PR, we miss some optimization becuase gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds __builtin_trap after them. This is seen as a side-effect by IPA analys= is and additionally the (fully unreachable) builtin_trap is believed to lo= ad all global memory. I think we should think of less intrusive gimple representation of this, but it is also easy enough to special case that in IPA analysers as done in this patch. This is a win even if we improve the representation since gimple-ssa-isolate-paths is run late and this way we improve optimizati= on early. This affects 1623 functions during cc1plus link. Bootstrapped/regtested x86_64-linux, comitted. gcc/ChangeLog: 2021-12-12 Jan Hubicka PR ipa/103665 * ipa-modref.c (modref_access_analysis::analyze): Terminate BB analysis on NULL memory access. * ipa-pure-const.c (analyze_function): Likewise.=