[llvm-bugs] [Bug 50767] New: Function __attribute__((nodebug)) inconsistency causes crash

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 18 05:07:36 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50767

            Bug ID: 50767
           Summary: Function __attribute__((nodebug)) inconsistency causes
                    crash
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bruno-llvm at defraine.net
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

When the nodebug attribute of a function appears only at its definition (so an
earlier declaration of the function did not have the attribute) this crashes
clang.

Example:

  void foo();

  void use() { foo(); }

  __attribute__((nodebug)) void foo() { }

Command:
   clang -c -g1 -O nodbg.cpp

Godbolt link: https://godbolt.org/z/nTYKW66Gf

On an assertion build, I think the error message is "function definition may
only have a distinct !dbg attachment" then "fatal error: error in backend:
Broken module found, compilation aborted!"

If needed that you annotate earlier declarations with nodebug, clang should
enforce this?

-- 
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/20210618/3e16231c/attachment.html>


More information about the llvm-bugs mailing list