[PATCH] D150930: [Driver] Accept and ignore -fno-lifetime-dse argument

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 20:50:33 PDT 2023


MaskRay requested changes to this revision.
MaskRay added a comment.
This revision now requires changes to proceed.

I object to parse and ignore this GCC option, which appears obscure.
Clang traditionally added many `clang_ignored_gcc_optimization_f_Group` and `IgnoredGCCCompat` options to support a wide range of projects. This has been valuable in making Clang adopted in the open-source community.
Nowadays, GCC-only software has been increasingly obscure.

The original request to accept `-fno-lifetime-dse` is so that someone's clang-tidy or other clang tooling can accept `compile_commands.json` produced by GCC.
I want to highlight that this isn't a supported use. Just like I keep Linux kernel builds with both GCC and Clang. I use the Clang one for ccls (a language server) but the GCC one for debugging.
I don't mix-and-match as the GCC build has a dozen options that Clang doesn't recognize

  // from 2019
  ccls -index ~/Dev/Linux -init='{"clang":{"excludeArgs":[
  "-falign-jumps=1","-falign-loops=1","-fconserve-stack","-fmerge-constants","-fno-code-hoisting","-fno-schedule-insns","-fno-sched-pressure","-fno-var-tracking-assignments","-fsched-pressure",
  "-mhard-float","-mindirect-branch-register","-mindirect-branch=thunk-inline","-mpreferred-stack-boundary=2","-mpreferred-stack-boundary=3","-mpreferred-stack-boundary=4","-mrecord-mcount","-mindirect-branch=thunk-extern","-mno-fp-ret-in-387","-mskip-rax-setup",
  "--param=allow-store-data-races=0","-Wa,arch/x86/kernel/macros.s","-Wa,-"
  ], "extraArgs":["--gcc-toolchain=/usr"]}}'

I think we need a higher bar than just appeasing such unsupported use cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150930/new/

https://reviews.llvm.org/D150930



More information about the cfe-commits mailing list