https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103830
--- Comment #5 from hubicka at kam dot mff.cuni.cz --- > I think the recent modref change made the function const. > > And no, we shouldn't DSE any volatile store and generally we don't. It's > probably some side-effect of modref that we do. Using -fno-ipa-pure-const > "fixes" this bug with -Og: > > local analysis of void MyClass::call()/1 > NULL memory access; terminating BB > Function is locally const. > callgraph: > > so it's caused by the recent change to mitigate path-isolation damage to > modref. The change indeed assumes that with -fdelete-null-pointer-checks the access to NULL is invalid no matter if it is volatile or normal. I would expect code having exception handlers at address 0 to be always built with -fno-delete-null-pointer-checks. If we want to preserve user defined volaitle NULL, is there way to stick another flag on the memory accesses synthetised by isolate-paths to mark them as OK to be optimized this way?