pcc added a comment. In https://reviews.llvm.org/D30920#700077, @tejohnson wrote:
> Until everything is converted to using size attributes, it seems like a > correct fix for the bug is to accept these options in the gold-plugin and > pass through the LTO API to the PassManagerBuilder. Not necessarily. There is no requirement (from a correctness perspective) that `-Os` at link time should exactly match the behaviour of `-Os` at compile time. ================ Comment at: lib/Driver/ToolChains/CommonArgs.cpp:375 + // They are captured by corresponding function attributes. + if (!OptLevel.equals("s") && !OptLevel.equals("z")) + OOpt = OptLevel; ---------------- This can just be `OptLevel != "s"` etc. ================ Comment at: test/Driver/gold-lto.c:33 +// RUN: | FileCheck %s --implicit-check-not "-plugin-opt=Os" +// RUN: %clang -### %t.o -flto -Os 2>&1 \ +// RUN: | FileCheck %s --implicit-check-not "-plugin-opt=Oz" ---------------- `-Oz` here. https://reviews.llvm.org/D30920 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits