On Mon, Sep 8, 2025 at 3:16 PM Jakub Jelinek <ja...@redhat.com> wrote: > > On Mon, Sep 08, 2025 at 03:05:58PM +0200, Richard Biener wrote: > > is reduced to __builtin_abort () (for C++). That's because it's > > __builtin_unreachable () at the end. I am not aware of any > > other "UB" than missed return that we turn into unreachable(), > > even > > > > unsigned int foo (unsigned int i) > > { > > if (i < 33) > > __builtin_abort (); > > return i << i; > > } > > > > isn't handled this way. But sure we could, in the future. > > std::... before the return would help in case it is considered > > a barrier that might not continue to the UB. > > What is gimple-ssa-isolate-paths.cc doing then?
Nothing in the above case - we only isolate null pointer dereferences IIRC. > I thought it is about obvious UBs like null pointer dereferences etc. > and the whole paths can be turned into e.g. __builtin_trap() with it > and for anything dominated by the UB that is just fine from the POV of this > C++ paper and it only a question if we don't propagate it also backwards > across calls (or other statements if std::observable_checkpoint would be > e.g. inline function with nothing in it and no special attributes). So I've now read the paper and it's motivated by C++ contracts. I have no idea how they'd be actually implemented, so I can't say if it's sensible for those. The only "example" is for in(p) in (*p > 5) where the contract *p > 5 would "elide" the 'p' one. Whatever "eliding" means here. Richard. > Jakub >