On Mon, Oct 10, 2022 at 05:09:29PM -0400, Jason Merrill wrote: > On 10/10/22 04:54, Jakub Jelinek via Gcc-patches wrote: > > My earlier patches gimplify the simplest non-side-effects assumptions > > into if (cond) ; else __builtin_unreachable (); and throw the rest > > on the floor. > > The following patch attempts to do something with the rest too. > > For -O0, it actually throws even the simplest assumptions on the floor, > > we don't expect optimizations and the assumptions are there to allow > > optimizations. > > I'd think we should trap on failed assume at -O0 (i.e. with > -funreachable-traps).
For the simple conditions? Perhaps. But for the side-effects cases that doesn't seem to be easily possible. Jakub