From 997130f778c56466a825627644e510960585521b Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Tue, 26 Oct 2021 07:28:09 +0000 Subject: target: [PR102941] Fix inline-asm flags with non-REG_P output So the problem here is that arm_md_asm_adjust would just create a set directly to the output memory which is wrong. It needs to output to a temp register first and then do a move. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. I have no way to test on arm even though this touches common code. PR target/102941 gcc/ChangeLog: * config/arm/aarch-common.c (arm_md_asm_adjust): Use a temp if !REG_P. gcc/testsuite/ChangeLog: * gcc.target/aarch64/asm-flag-7.c: New test. * gcc.target/arm/asm-flag-7.c: New test. --- gcc/config/arm/aarch-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/config') diff --git a/gcc/config/arm/aarch-common.c b/gcc/config/arm/aarch-common.c index 812017a..04a53d7 100644 --- a/gcc/config/arm/aarch-common.c +++ b/gcc/config/arm/aarch-common.c @@ -641,7 +641,7 @@ arm_md_asm_adjust (vec &outputs, vec & /*inputs*/, rtx x = gen_rtx_REG (mode, CC_REGNUM); x = gen_rtx_fmt_ee (code, word_mode, x, const0_rtx); - if (dest_mode == word_mode) + if (dest_mode == word_mode && REG_P (dest)) emit_insn (gen_rtx_SET (dest, x)); else { -- cgit v1.1