[llvm-bugs] [Bug 37642] clang with -O0 doesn't generate a section on static variable.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 31 10:39:29 PDT 2018


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

Eli Friedman <efriedma at codeaurora.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |efriedma at codeaurora.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #4 from Eli Friedman <efriedma at codeaurora.org> ---
If the symbol is actually used in some way the compiler can't see, you can mark
it with __attribute__((used)), and it will be emitted at any optimization
level.

We aren't going to try to make clang's -O0 precisely match gcc's -O0.  -O0 has
essentially two goals: emitting code quickly, and emitting code with accurate
debug information.  Emitting unused globals doesn't help either of those goals.

-- 
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/20180531/ceef899d/attachment.html>


More information about the llvm-bugs mailing list