Message ID | 20200619095345.46238-1-kito.cheng@sifive.com |
---|---|
State | New |
Headers | show |
Series | RISC-V: Normalize arch string in driver time | expand |
On Fri, Jun 19, 2020 at 2:53 AM Kito Cheng <kito.cheng@sifive.com> wrote:
> * config/riscv/riscv.h (DRIVER_SELF_SPECS): New.
This looks good to me. This has the side effect that we are now
passing -march twice to cc1 and as, but that should be harmless as the
last one wins. I think this makes the riscv_expand_arch call in
ASM_SPECS redundant, but it isn't really hurting anything if we end up
with extra unnecessary calls to riscv_expand_arch so that is an
optional possible cleanup.
Jim
Hi Jim: Thanks for your review, committed with ASM_SPECS clean up. > This has the side effect that we are now passing -march twice to cc1 and as, but that should be harmless as the last one wins. Yeah, I tried to find a way to remove the duplication but have not found a good solution yet. On Sun, Jun 21, 2020 at 5:37 AM Jim Wilson <jimw@sifive.com> wrote: > > On Fri, Jun 19, 2020 at 2:53 AM Kito Cheng <kito.cheng@sifive.com> wrote: > > * config/riscv/riscv.h (DRIVER_SELF_SPECS): New. > > This looks good to me. This has the side effect that we are now > passing -march twice to cc1 and as, but that should be harmless as the > last one wins. I think this makes the riscv_expand_arch call in > ASM_SPECS redundant, but it isn't really hurting anything if we end up > with extra unnecessary calls to riscv_expand_arch so that is an > optional possible cleanup. > > Jim
diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 6119e6350620..1f2fe7e10e05 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -68,6 +68,10 @@ extern const char *riscv_expand_arch (int argc, const char **argv); %{mabi=*} \ %(subtarget_asm_spec)" +#undef DRIVER_SELF_SPECS +#define DRIVER_SELF_SPECS \ +"%{march=*:-march=%:riscv_expand_arch(%*)}" + #define TARGET_DEFAULT_CMODEL CM_MEDLOW #define LOCAL_LABEL_PREFIX "."