From a8532e9927ad6e4bbedbb957b02ca413aedf9098 Mon Sep 17 00:00:00 2001 From: Jiufu Guo Date: Mon, 17 Feb 2020 10:48:39 +0800 Subject: rs6000: mark clobber for registers changed by untpyed_call As PR93047 said, __builtin_apply/__builtin_return does not work well with -frename-registers. This is caused by return register(e.g. r3) is used to rename another register, before return register is stored to stack. This patch fix this issue by emitting clobber for those egisters which maybe changed by untyped call. gcc/ 2020-02-17 Jiufu Guo PR target/93047 * config/rs6000/rs6000.md (untyped_call): Add emit_clobber. gcc/testsuite 2020-02-17 Jiufu Guo PR target/93047 * gcc.dg/torture/stackalign/builtin-return-2.c: New test case. --- gcc/config/rs6000/rs6000.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/config/rs6000/rs6000.md') diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 3da7b1ed9c2..ad88b6783af 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -10870,6 +10870,10 @@ emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx)); + for (int i = 0; i < XVECLEN (operands[2], 0); i++) + emit_clobber (SET_SRC (XVECEXP (operands[2], 0, i))); + emit_insn (gen_blockage ()); + for (i = 0; i < XVECLEN (operands[2], 0); i++) { rtx set = XVECEXP (operands[2], 0, i); -- cgit v1.2.3