diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2022-06-05 22:19:28 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2022-06-05 22:19:28 +0200 |
commit | b3cf30ba5b47dfa7414416fe3bc5ae34db6065e7 (patch) | |
tree | aaa635a9d12f6c282a83ce53fe2b955406a99309 | |
parent | d9c17b4dc21ef531d673d1d6e510347e141e6801 (diff) | |
parent | b296539554213125eb8f61291c862eec190e4c9b (diff) | |
download | sparse-b3cf30ba5b47dfa7414416fe3bc5ae34db6065e7.tar.gz |
Merge branch 'riscv'
* riscv: small improvements of '-march' parsing
-rw-r--r-- | target-riscv.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/target-riscv.c b/target-riscv.c index 3bba7c15..217ab7e8 100644 --- a/target-riscv.c +++ b/target-riscv.c @@ -3,6 +3,7 @@ #include "target.h" #include "machine.h" #include <string.h> +#include <stdio.h> #define RISCV_32BIT (1 << 0) #define RISCV_64BIT (1 << 1) @@ -37,23 +38,15 @@ static void parse_march_riscv(const char *arg) { "a", RISCV_ATOMIC }, { "f", RISCV_FLOAT|RISCV_FDIV|RISCV_ZICSR }, { "d", RISCV_DOUBLE|RISCV_FDIV|RISCV_ZICSR }, - { "g", RISCV_GENERIC }, - { "q", 0 }, - { "l", 0 }, { "c", RISCV_COMP }, - { "b", 0 }, - { "j", 0 }, - { "t", 0 }, - { "p", 0 }, - { "v", 0 }, - { "n", 0 }, - { "h", 0 }, - { "s", 0 }, { "_zicsr", RISCV_ZICSR }, { "_zifencei", RISCV_ZIFENCEI }, }; int i; + // Each -march=.. options entirely overrides previous ones + riscv_flags = 0; + for (i = 0; i < ARRAY_SIZE(basic_sets); i++) { const char *pat = basic_sets[i].pattern; size_t len = strlen(pat); @@ -64,7 +57,10 @@ static void parse_march_riscv(const char *arg) goto ext; } } - die("invalid argument to '-march': '%s'\n", arg); + +unknown: + fprintf(stderr, "WARNING: invalid argument to '-march': '%s'\n", arg); + return; ext: for (i = 0; i < ARRAY_SIZE(extensions); i++) { @@ -77,7 +73,7 @@ ext: } } if (arg[0]) - die("invalid argument to '-march': '%s'\n", arg); + goto unknown; } static void init_riscv(const struct target *self) |