Re: [PATCH] gimple-iterator, ubsan: Fix ICE during instrumentation of returns_twice calls [PR112709]

2024-03-12 Thread Richard Biener
On Tue, 12 Mar 2024, Jakub Jelinek wrote: > On Tue, Mar 12, 2024 at 01:47:53PM +0100, Richard Biener wrote: > > > Admittedly the above is the ugliest part of the patch IMHO. > > > It isn't needed in all cases, but e.g. for the pr112709-2.c (qux) case > > > we have before ubsan pass > > > # _7(ab

Re: [PATCH] gimple-iterator, ubsan: Fix ICE during instrumentation of returns_twice calls [PR112709]

2024-03-12 Thread Jakub Jelinek
On Tue, Mar 12, 2024 at 01:47:53PM +0100, Richard Biener wrote: > > Admittedly the above is the ugliest part of the patch IMHO. > > It isn't needed in all cases, but e.g. for the pr112709-2.c (qux) case > > we have before ubsan pass > > # _7(ab) = PHI <_20(9), _8(ab)(11)> > > _22 = bar (*_7(ab)

Re: [PATCH] gimple-iterator, ubsan: Fix ICE during instrumentation of returns_twice calls [PR112709]

2024-03-12 Thread Richard Biener
On Tue, 12 Mar 2024, Jakub Jelinek wrote: > On Tue, Mar 12, 2024 at 11:42:03AM +0100, Richard Biener wrote: > > > +static edge > > > +edge_before_returns_twice_call (basic_block bb) > > > +{ > > > + gimple_stmt_iterator gsi = gsi_start_nondebug_bb (bb); > > > + gcc_checking_assert (is_gimple_cal

Re: [PATCH] gimple-iterator, ubsan: Fix ICE during instrumentation of returns_twice calls [PR112709]

2024-03-12 Thread Jakub Jelinek
On Tue, Mar 12, 2024 at 11:42:03AM +0100, Richard Biener wrote: > > +static edge > > +edge_before_returns_twice_call (basic_block bb) > > +{ > > + gimple_stmt_iterator gsi = gsi_start_nondebug_bb (bb); > > + gcc_checking_assert (is_gimple_call (gsi_stmt (gsi)) > > + && (gimple_ca

Re: [PATCH] gimple-iterator, ubsan: Fix ICE during instrumentation of returns_twice calls [PR112709]

2024-03-12 Thread Richard Biener
On Tue, 12 Mar 2024, Jakub Jelinek wrote: > Hi! > > ubsan, asan (both PR112709) and _BitInt lowering (PR113466) want to > insert some instrumentation or adjustment statements before some statement. > This unfortunately creates invalid IL if inserting before a returns_twice > call, because we requ

[PATCH] gimple-iterator, ubsan: Fix ICE during instrumentation of returns_twice calls [PR112709]

2024-03-12 Thread Jakub Jelinek
Hi! ubsan, asan (both PR112709) and _BitInt lowering (PR113466) want to insert some instrumentation or adjustment statements before some statement. This unfortunately creates invalid IL if inserting before a returns_twice call, because we require that such calls are the first statement in a basic