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