diff options
author | James E. Wilson <wilson@codesourcery.com> | 2010-05-20 06:26:52 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2010-05-19 23:26:52 -0700 |
commit | 951771dc6becb8dc1b0e6b691489aeb8f3aa08a7 (patch) | |
tree | 445cf456f3f7d845409bbb0971019da3abf14bef | |
parent | 6d1b0f922a46b7459c0a9441f728e9214b1bcd80 (diff) | |
download | gcc-951771dc6becb8dc1b0e6b691489aeb8f3aa08a7.zip gcc-951771dc6becb8dc1b0e6b691489aeb8f3aa08a7.tar.gz gcc-951771dc6becb8dc1b0e6b691489aeb8f3aa08a7.tar.bz2 |
re PR target/43764 (-mrelax-pic-calls fails with complex types)
PR target/43764
* mips.c (mips_call_expr_from_insn): New arg second_call. Set it.
(mips_annotate_pic_calls): Pass new arg to mips_call_expr_from_insn.
Use it.
From-SVN: r159610
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 31 |
2 files changed, 31 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3816df0..d372423 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-05-19 James E. Wilson <wilson@codesourcery.com> + + PR target/43764 + * mips.c (mips_call_expr_from_insn): New arg second_call. Set it. + (mips_annotate_pic_calls): Pass new arg to mips_call_expr_from_insn. + Use it. + 2010-05-19 Joseph Myers <joseph@codesourcery.com> * diagnostic.c (FLOAT, FFS): Don't undefine. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index e0b594f..38664b5 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -14006,23 +14006,35 @@ r10k_insert_cache_barriers (void) } /* If INSN is a call, return the underlying CALL expr. Return NULL_RTX - otherwise. */ + otherwise. If INSN has two call rtx, then store the second one in + SECOND_CALL. */ static rtx -mips_call_expr_from_insn (rtx insn) +mips_call_expr_from_insn (rtx insn, rtx *second_call) { rtx x; + rtx x2; if (!CALL_P (insn)) return NULL_RTX; x = PATTERN (insn); if (GET_CODE (x) == PARALLEL) - x = XVECEXP (x, 0, 0); + { + /* Calls returning complex values have two CALL rtx. Look for the second + one here, and return it via the SECOND_CALL arg. */ + x2 = XVECEXP (x, 0, 1); + if (GET_CODE (x2) == SET) + x2 = XEXP (x2, 1); + if (GET_CODE (x2) == CALL) + *second_call = x2; + + x = XVECEXP (x, 0, 0); + } if (GET_CODE (x) == SET) x = XEXP (x, 1); - gcc_assert (GET_CODE (x) == CALL); + return x; } @@ -14154,9 +14166,10 @@ mips_annotate_pic_calls (void) FOR_EACH_BB (bb) FOR_BB_INSNS (bb, insn) { - rtx call, reg, symbol; + rtx call, reg, symbol, second_call; - call = mips_call_expr_from_insn (insn); + second_call = 0; + call = mips_call_expr_from_insn (insn, &second_call); if (!call) continue; gcc_assert (MEM_P (XEXP (call, 0))); @@ -14166,7 +14179,11 @@ mips_annotate_pic_calls (void) symbol = mips_find_pic_call_symbol (insn, reg); if (symbol) - mips_annotate_pic_call_expr (call, symbol); + { + mips_annotate_pic_call_expr (call, symbol); + if (second_call) + mips_annotate_pic_call_expr (second_call, symbol); + } } } |