[llvm-bugs] [Bug 41568] New: [LTO] -Os and -Oz -flto results in error message from LTO code generator.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 23 07:31:23 PDT 2019


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

            Bug ID: 41568
           Summary: [LTO] -Os and -Oz -flto results in error message from
                    LTO code generator.
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: lto
          Assignee: unassignedbugs at nondot.org
          Reporter: peter.smith at linaro.org
                CC: llvm-bugs at lists.llvm.org

clang t.c -Os -flto -o optlto -fuse-ld=lld
ld.lld: error: -plugin-opt=Os: number expected, but got 's'
clang-9: error: linker command failed with exit code 1 (use -v to see
invocation)

Anything that will compile will do for the t.c file, I used an empty main.

This is the same for -Oz. While the error is reported by LLD it is coming from
the LTO Code Generator.

This has been raised before as https://bugs.llvm.org/show_bug.cgi?id=31665
however it was closed by the raiser as invalid as the optsize and minsize
attributes are added to the functions when they were compiled.

However I think that there still could be some work to do here:
- It isn't convenient to change the optimization flags just for the link steps
in some build systems. It also isn't discoverable what the equivalent
optimization setting should be given as a replacement. I believe -O2 comes
closest.
- When using the new pass manager there are some passes that check the
PassBuilder optimisation setting using isOptimizingForSize(). I think the
impact on code-generation will be low, but this may change in the future.

At this stage I don't think that supporting -Os and -Oz need be much more than
translating to one of the other optimization levels. Of course there could be a
custom size focused -Os, -Oz LTO added later.

-- 
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/20190423/b68b85fc/attachment.html>


More information about the llvm-bugs mailing list