On Mon, 13 Dec 2021, Richard Biener wrote: > On December 13, 2021 3:25:47 PM GMT+01:00, Alexander Monakov > <amona...@ispras.ru> wrote: > >Greetings! > > > >While testing our patch that reimplements -Wclobbered on GIMPLE we found > >a case where tree-ssa-sink moves a statement to a basic block in front > >of a setjmp call. > > > >I am confident that this is unintended and should be considered invalid > >GIMPLE. > > Does CFG validation not catch this? That is, doesn't setjmp force the start of > a new BB?
Oh, good point. There's stmt_start_bb_p which returns true for setjmp, but gimple_verify_flow_info doesn't check it. I guess we can try adding that and collect the fallout on bootstrap/regtest. > I think sinking relies on dominance and post dominance here but post dominance > may be too fragile with the abnormal cycles which are likely not backwards > reachable from exit. > > That said, checking for abnormal preds is OK, I just want to make sure we > detect the invalid CFG - do we? As above, no, otherwise it would have been caught much earlier than ICE'ing our -Wclobbered patch :) Thank you. Alexander