Hi Jim:

> When I try this patch, I see an error:
>
> rohan:2132$ ./xgcc -B./ -O -march=rv64imafdc -mabi=lp64d  tmp.c
> /tmp/ccULN36f.s: Assembler messages:
> /tmp/ccULN36f.s:3: Fatal error:
> -march=rv64i2p0_m2p0_a2p0_f2p0_f2p0_d2p0_c2p0: ISA string is not in
> canonical order. `f'
> rohan:2133$
>
> Looks like you need to make sure that we don't add the implied F if it
> is already there.  Otherwise, this looks OK to me.

Thanks, I should add a testcase for that :)

>
> We don't have support for these implied extensions in binutils yet.
> If we are adding it to gcc, we should probably add it to binutils too.
> Maybe you can ask Nelson to work on that.

I also found another issue: assembler will complain when passing -march=rv64id,
 because it does not accept implied extensions yet...

$ riscv64-unknown-elf-gcc ~/hello.c -march=rv64id  -c
# GCC also invoke as with -march=rv64id
Assembler messages:
Fatal error: -march=rv64id: `d' extension requires `f' extension

However if we require assembler support that means we need to bump the
binutils version requirement again and might break backward compatibility,
so I guess we can transform -march= via spec functions?
I'll send a v2 patch with this approach.

diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index 567c23380fe..38644436f7c 100644
--- a/gcc/config/riscv/riscv.h
+++ b/gcc/config/riscv/riscv.h
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3.  If not see
   --with-tune is ignored if -mtune is specified.  */
#define OPTION_DEFAULT_SPECS \
  {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
-  {"arch", "%{!march=*:-march=%(VALUE)}" }, \
+  {"arch", "%{!march=*:%:riscv_expand_arch(%(VALUE))}" }, \
  {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \

#ifdef IN_LIBGCC2


Thanks :)

>
> > +      /* TODO: Implied extension might use differet version.  */
>
> differet -> different
>
> Jim

Reply via email to