public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103665] New: insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations
@ 2021-12-11 22:03 hubicka at gcc dot gnu.org
2021-12-12 10:38 ` [Bug tree-optimization/103665] " cvs-commit at gcc dot gnu.org
2022-01-04 9:36 ` rguenth at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-12-11 22:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103665
Bug ID: 103665
Summary: insert_trap in gimple-isolate-paths interferes badly
with modref, pure-const and other optimizations
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: hubicka at gcc dot gnu.org
Target Milestone: ---
When we detect load/store of NULL memory we produce:
_9 ={v} MEM[(union tree_node *)0B].base.code;
__builtin_trap ();
The volatile memory store is intended to keep program segfaulting as it did
before. However this representation is bad because it is now considered a
significant side-effects. This prevents such function from being discovered as
pure/const and prevents other useful optimizations too
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/103665] insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations
2021-12-11 22:03 [Bug tree-optimization/103665] New: insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations hubicka at gcc dot gnu.org
@ 2021-12-12 10:38 ` cvs-commit at gcc dot gnu.org
2022-01-04 9:36 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-12 10:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103665
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:
https://gcc.gnu.org/g:e93809f62363ba4b233858005aef652fb550e896
commit r12-5915-ge93809f62363ba4b233858005aef652fb550e896
Author: Jan Hubicka <jh@suse.cz>
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 analysis
and additionally the (fully unreachable) builtin_trap is believed to load
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 optimization
early.
This affects 1623 functions during cc1plus link.
Bootstrapped/regtested x86_64-linux, comitted.
gcc/ChangeLog:
2021-12-12 Jan Hubicka <hubicka@ucw.cz>
PR ipa/103665
* ipa-modref.c (modref_access_analysis::analyze): Terminate BB
analysis on NULL memory access.
* ipa-pure-const.c (analyze_function): Likewise.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/103665] insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations
2021-12-11 22:03 [Bug tree-optimization/103665] New: insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations hubicka at gcc dot gnu.org
2021-12-12 10:38 ` [Bug tree-optimization/103665] " cvs-commit at gcc dot gnu.org
@ 2022-01-04 9:36 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-04 9:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103665
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Maybe we can simply use
__builtin_trap[_mem] (&MEM[(union tree_node *)0B].base.code);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-04 9:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11 22:03 [Bug tree-optimization/103665] New: insert_trap in gimple-isolate-paths interferes badly with modref, pure-const and other optimizations hubicka at gcc dot gnu.org
2021-12-12 10:38 ` [Bug tree-optimization/103665] " cvs-commit at gcc dot gnu.org
2022-01-04 9:36 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).