diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2004-09-09 20:36:31 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2004-09-09 20:36:31 +0000 |
commit | b2416742352d9a2def00e2a63a6c90bdbda910f6 (patch) | |
tree | a1fd241b5a6536188a6eaccced78d1de1d698a69 /gcc/config | |
parent | da3107f38b72d49e39ca0386b2ecc94deed9bcce (diff) | |
download | gcc-b2416742352d9a2def00e2a63a6c90bdbda910f6.zip gcc-b2416742352d9a2def00e2a63a6c90bdbda910f6.tar.gz gcc-b2416742352d9a2def00e2a63a6c90bdbda910f6.tar.bz2 |
re PR target/17377 (cris.md bug in "return" pattern trigged by __builtin_return_address)
PR target/17377
* config/cris/cris-protos.h (cris_return_address_on_stack): Declare.
* config/cris/cris.c (cris_return_address_on_stack): New function.
* config/cris/cris.md ("return"): For location of return address,
also check cris_return_address_on_stack.
From-SVN: r87251
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/cris/cris-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/cris/cris.c | 9 | ||||
-rw-r--r-- | gcc/config/cris/cris.md | 8 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h index 0e65dc2..15e91df 100644 --- a/gcc/config/cris/cris-protos.h +++ b/gcc/config/cris/cris-protos.h @@ -47,6 +47,8 @@ extern int cris_cfun_uses_pic_table (void); extern void cris_target_asm_named_section (const char *, unsigned int); #endif /* RTX_CODE */ +extern int cris_return_address_on_stack (void); + extern void cris_pragma_expand_mul (struct cpp_reader *); /* Need one that returns an int; usable in expressions. */ diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 25db5ec..468859f 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -1700,6 +1700,15 @@ cris_return_addr_rtx (int count, rtx frameaddr ATTRIBUTE_UNUSED) : NULL_RTX; } +/* Accessor used in cris.md:return because cfun->machine isn't available + there. */ + +int +cris_return_address_on_stack () +{ + return cfun->machine->needs_return_address_on_stack; +} + /* This used to be the INITIAL_FRAME_POINTER_OFFSET worker; now only handles FP -> SP elimination offset. */ diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index 4001a2a..be137a5 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -3415,7 +3415,8 @@ if (i >= 0) sprintf (rd, \"movem [$sp+],$%s\", reg_names [i]); - if (regs_ever_live[CRIS_SRP_REGNUM]) + if (regs_ever_live[CRIS_SRP_REGNUM] + || cris_return_address_on_stack ()) { if (*rd) output_asm_insn (rd, operands); @@ -3433,7 +3434,10 @@ }" [(set (attr "slottable") (if_then_else - (ne (symbol_ref "regs_ever_live[CRIS_SRP_REGNUM]") (const_int 0)) + (ne (symbol_ref + "(regs_ever_live[CRIS_SRP_REGNUM] + || cris_return_address_on_stack ())") + (const_int 0)) (const_string "no") ; If jump then not slottable. (if_then_else (ne (symbol_ref |