https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110728

--- Comment #10 from Nick Desaulniers <ndesaulniers at google dot com> ---
(In reply to Michael Matz from comment #9)
> That has to do with how we need to (possibly)
> split
> critical edges, which changes label identity, which in turn might actually
> be the thing that's required by the asmgoto.

(Addressing just this point for now.)

I don't think that's a problem for users of asm goto; GCC (and Clang) will
already split critical edges when using asm goto with outputs (thus creating
the case you describe where the label that the asm will jump to has been
synthesized and may differ from the final actual destination).

For example:

```c
void bar (void);

int foo (int y) {
    int x;

    if (y)
        goto end;

    asm goto ("# %1 %2":"=r"(x):"i"(&&end)::end);
    bar();
    return 0;
end:
    return x;
}
```

in the above, %1 may not equal %2.

I documented this behavior in clang
https://github.com/llvm/llvm-project/commit/329ef60f3e21fd6845e8e8b0da405cae7eb27267#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97
which will be in the clang-17 release notes once clang-17 ships (currently in
-rc).

I also don't see that being a problem for the Linux kernel at the moment,
though they may need to consider that behavior.

Reply via email to