<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/106781>106781</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Backward jumps to some local labels in inline assembly fail to compile
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            inline-asm,
            regression:19
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jmgorius
      </td>
    </tr>
</table>

<pre>
    Backward jumps to local labels `0[0-9]*` and `1[0-9]*` fail to compile using clang version 19.1.0-rc3, when using the `-masm=intel` compiler flag.

The following code compiles fine with clang 18.1.8 and gcc 14.2, but fails to compile with clang's latest release candidate.

```c
// test.c
__asm__("0:\n"
        "    jmp 0b\n");
```

Clang 19.1.0-rc3 complains with the following error message:

```
$ clang -c -masm=intel test.c
<inline asm>:2:5: error: invalid operand for instruction
    2 |     jmp 0b
      | ^
1 error generated.
```

A similar error occurs when the local label name is changed to `1`. It only seems to occur for label names that start with either `0` or `1`, and only when compiling with `-masm=intel`.

### Exact compiler version

```sh
$ clang --version
clang version 19.1.0-rc3 (git@github.com:llvm/llvm-project.git 5f744ee5c770d7332740bb6247f961e7d99ee359)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VMuO6ygQ_RqyKcXCgF8LL9JJR7r72bcwrtj0xRAB7sffj7Ddt5NMz42sOIF6nnOqZAh6sIgtKZ5IcdrJOY7Ot6_T4Lyew65z_Wf7JNXvd-l7eJ2na4DowDglDRjZoQlASkpJ8UT3DSlOhB1ISUHaPp3nj-cXqU0KoNx01QZhDtoOoIy0A7yhD9pZyJssz-jeK07YEd5HtJtZHDEF3U8yTISftI1oUtAtmIeLkUNG6InQw_r9z4hwcca49yWN6_HLOMBFW4R3HcctfV5neVYvlQ9KQS4ylvJ3c1yqDr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