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

            Bug ID: 98096
           Summary: Inconsistent operand numbering for asm goto with
                    in-out operands
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwjagersma at gmail dot com
  Target Milestone: ---

For the following code:

    asm goto ("# %0 %1 %2" : "+r" (i) ::: jmp);

Two registers are printed before the label name, because the in-out operand is
split internally.  This is somewhat surprising from a user perspective.

But then:

    asm goto ("# %l[jmp]" : "+r" (i) ::: jmp);

Produces an error: '%l' operand isn't a label.

So label operands are numbered after the in-out operand is split, but %l is
evaluated without this split taken into account.  Docs suggest it should be
possible to use asm goto with both in-outs and %l operands simultaneously.

Reply via email to