On Mon, Jul 08, 2024 at 09:06:21AM +0200, Richard Biener wrote: > On Sat, Jul 6, 2024 at 8:45 PM Andi Kleen <a...@linux.intel.com> wrote: > > > > > > if (!single_succ_p (bb)) > > > > - return; > > > > + { > > > > + int num_eh, num_other; > > > > + bb_get_succ_edge_count (bb, num_eh, num_other); > > > > + /* Allow EH edges so that we can give a better > > > > + error message later. */ > > > > > > Please instead use has_abnormal_or_eh_outgoing_edge_p (bb) instead > > > > That's not equivalent, need a num_other == 1 check too. > > There can be at most one regular outgoing edge for a block with an > outgoing EH or abnormal edge.
GIMPLE_CONDs cannot trigger EH? > > Do you want me to move the function to a generic place? > > Maybe you can use find_fallthru_edge () instead if you think > has_abnormal_or_eh_outgoing_edge_p isn't good enough? That will > find the single_succ_edge when the BB isn't single_succ_p because > of EH/abnormal edges. > > I think both choices would be equivalent to your new function and its use. Okay will do the later. > The comment above the check is a bit weird in how it talks about types, but > "tail call must be same type" isn't very helpful and it isn't in any way > related > to the actual check being performed. "return slot" is supposed to be the > storage used for return pointed to by the invisible reference parameter to > space allocated by the caller. Do you know a more C/C++ standard related > naming for this? I don't have a better name. Probably the right thing would be to use whatever term the respective ABI uses, but that may not be the same for every target. I used your suggestion. -Andi