diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-04 15:05:37 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-04 15:39:53 +0200 |
commit | 60aa5705d990c92f8afdbc9bb401ad202a68b9e8 (patch) | |
tree | 1741e85756e4990b7c53a81ec33843de38d9a2c8 | |
parent | dcf7d2a15920303ff74df298f3fb1cf29289c118 (diff) | |
download | sparse-60aa5705d990c92f8afdbc9bb401ad202a68b9e8.tar.gz |
add memory asm constraint for PPC
The 'Z' asm constraint is used for doing IO accessors on PPC but
isn't part of the 'common constraints'. It's responsible for
more than half of all warnings (with defconfig + allyesconfig).
Fix this by handling this constraint in a specific method for PPC.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | target-ppc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/target-ppc.c b/target-ppc.c index b138635b..c0d6068f 100644 --- a/target-ppc.c +++ b/target-ppc.c @@ -1,6 +1,7 @@ #include "symbol.h" #include "target.h" #include "machine.h" +#include "expression.h" static void predefine_ppc(const struct target *self) @@ -15,6 +16,16 @@ static void predefine_ppc(const struct target *self) predefine("_BIG_ENDIAN", 1, "1"); } +static const char *asm_constraint_ppc(struct asm_operand *op, int c, const char *str) +{ + switch (c) { + case 'Z': + op->is_memory = true; + break; + } + return str; +} + static void predefine_ppc32(const struct target *self) { @@ -32,6 +43,7 @@ const struct target target_ppc32 = { .target_64bit = &target_ppc64, .predefine = predefine_ppc32, + .asm_constraint = asm_constraint_ppc, }; @@ -55,4 +67,5 @@ const struct target target_ppc64 = { .target_32bit = &target_ppc32, .predefine = predefine_ppc64, + .asm_constraint = asm_constraint_ppc, }; |