[llvm-bugs] [Bug 51161] New: `-mattr` should be encoded in the IR for LTO's sake

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 22 01:14:18 PDT 2021


            Bug ID: 51161
           Summary: `-mattr` should be encoded in the IR for LTO's sake
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: twd2.me at gmail.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

Created attachment 25046
  --> https://bugs.llvm.org/attachment.cgi?id=25046&action=edit
The diagnostic information.

When compiling the following code with LTO:

$ cat test.c
void _start()
    asm volatile (
        ".balign 4\n\t"
        ".balign 4\n\t"

$ clang -march=rv64imac -O2 -flto -mno-relax -c test.c
$ ld.lld test.o

lld fails with `unable to write nop sequence of 2 bytes`.
The diagnostic information is attached.

It looks like to be due to the `HasStdExtC` check failure in
And, if I use `ld.lld -mllvm -mattr=+c test.o`, lld can generate proper machine
According to Nick Desaulniers [1], `-mattr` should be encoded in the IR for
LTO's sake.

My LLVM version: commit 1b61d837b9d0 ("[Inline] Add test for PR50589 (NFC)")

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210722/25fa689a/attachment.html>

More information about the llvm-bugs mailing list