Finding Fallthrough Block in CFG

I’m trying to find the “fallthrough” block in the CFG. The specific instance is a CFG block that ends in an “asm goto”

1: int out2;
T: asm volatile goto (“testl %0, %0; testl %1, %2; jne %l3” : “+S” (out1), “+D” (out2) : “r” (out1) : : label_true, loop);
Preds (1): B4
Succs (2): B2 B1

In this case, the “loop” target is also the fallthrough block:

int test2(int out1) {
int out2;
asm volatile goto(“testl %0, %0; testl %1, %2; jne %l3” : “+S”(out1), “+D”(out2) : “r”(out1) :: label_true, loop);
return out2;
return -2;

From the CFG output above, it’s hard to determine which of those successors is supposed to be the fallthrough. I could loop through the blocks in the CFG, but that seems unnecessarily wasteful. Is there a nicer way to figure this out?


Bumping this just in case it’s been missed.