[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 26 16:07:49 PDT 2024


MaskRay wrote:

> This change seems to have caused a test in emscripten to starting failing with `argument unused during compilation: '-O2'`: [emscripten-core/emscripten#21841](https://github.com/emscripten-core/emscripten/pull/21841).
> 
> Is that an intended side effect of this change? The fix on our end seems reasonable but posting here just in case.

The side effect was not anticipated, but it is desired. It's like that we emit other unused arg warnings for -D and many -f options. Thanks for the emscripten fix!
```
% fclang -c a.s -DA -O2
clang: warning: argument unused during compilation: '-D A' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-O2' [-Wunused-command-line-argument]
```

https://github.com/llvm/llvm-project/pull/90013


More information about the cfe-commits mailing list