Skip to content

inteldialect does not handle labels 0: or 1: on x86 #99547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tgross35 opened this issue Jul 18, 2024 · 2 comments
Open

inteldialect does not handle labels 0: or 1: on x86 #99547

tgross35 opened this issue Jul 18, 2024 · 2 comments

Comments

@tgross35
Copy link
Contributor

The below code:

define void @demo() {
start:
  call void asm inteldialect "0: jmp 0b", ""()
  ret void
}

Should build. Instead, it provides an inaccurate error message:

<inline asm>:2:5: error: invalid operand for instruction
        0: jmp 0b
           ^
Compiler returned: 1

This only happens on x86 and x86_64, other platforms seem not to be affected. This looks like another case of #35492, cc @rnk who authored 953bdce.

Link: https://llvm.godbolt.org/z/WWvWMzznK
Original repro: https://rust.godbolt.org/z/qP3Kd3Ts7

@tgross35
Copy link
Contributor Author

This reproduces in clang too with -masm=intel https://llvm.godbolt.org/z/5Gz6hnqxs

@llvmbot
Copy link
Member

llvmbot commented Jul 19, 2024

@llvm/issue-subscribers-backend-x86

Author: Trevor Gross (tgross35)

The below code:
define void @<!-- -->demo() {
start:
  call void asm inteldialect "0: jmp 0b", ""()
  ret void
}

Should build. Instead, it provides an inaccurate error message:

&lt;inline asm&gt;:2:5: error: invalid operand for instruction
        0: jmp 0b
           ^
Compiler returned: 1

This only happens on x86 and x86_64, other platforms seem not to be affected. This looks like another case of #35492, cc @rnk who authored 953bdce.

Link: https://llvm.godbolt.org/z/WWvWMzznK
Original repro: https://rust.godbolt.org/z/qP3Kd3Ts7

egkoppel added a commit to popcorn-2/popcorn-2 that referenced this issue Jul 27, 2024
egkoppel added a commit to popcorn-2/popcorn-2 that referenced this issue Jul 27, 2024
fixxxedpoint added a commit to fixxxedpoint/aleph-node that referenced this issue Sep 5, 2024
… the one provided with their repo is no longer able to build it (rust) due to a discovered bug in llvm (llvm/llvm-project#99547)

- removed a no longer needed FIX for the build procedure of the synthetic-network docker image - retagging of the node-js local image
lschuermann added a commit to encapfn/encapfn-mpk that referenced this issue Nov 10, 2024
As triggered by the `binary_asm_labels` lint:

    error: avoid using labels containing only the digits `0` and `1` in inline assembly
        --> encapfn-mpk/src/lib.rs:1294:20
         |
    1294 |                   jz 100f                // If zero, PKRU cleared correctly.
         |  ____________________^
    1295 | |                 ud2                    // If not zero, crash with an illegal insn
    1296 | |
    1297 | |               100: // _pkru_cleared
         | |_________________^ use a different label that doesn't start with `0` or `1`
         |
         = help: start numbering with `2` instead
         = note: an LLVM bug makes these labels ambiguous with a binary literal number on x86
         = note: see <llvm/llvm-project#99547> for more information
         = note: `#[deny(binary_asm_labels)]` on by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants