diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-01-23 08:24:38 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-01-23 08:24:38 +0000 |
commit | f9ae4df84ec291d01a49251ef5ffa17fa9674fce (patch) | |
tree | bf94a0c87d742a1c445f545a8cbf5dfc3bbab8cf /gcc/config | |
parent | e50f5f2e0d3396bd4ab2f799135309de39c96d58 (diff) | |
download | gcc-f9ae4df84ec291d01a49251ef5ffa17fa9674fce.zip gcc-f9ae4df84ec291d01a49251ef5ffa17fa9674fce.tar.gz gcc-f9ae4df84ec291d01a49251ef5ffa17fa9674fce.tar.bz2 |
re PR target/52125 (Problems with LO16 asm operands on MIPS)
gcc/
PR target/52125
* rtl.h (get_referenced_operands): Declare.
* recog.c (get_referenced_operands): New function.
* config/mips/mips.c (mips_reorg_process_insns): Check which asm
operands have been referenced when recording LO_SUM references.
gcc/testsuite/
PR target/52125
* gcc.dg/pr48774.c: Remove skip for mips_rel.
* gcc.target/mips/pr52125.c: New test.
From-SVN: r206955
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/mips/mips.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 6c6fe61..5bad0f8 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -16097,7 +16097,23 @@ mips_reorg_process_insns (void) for (insn = get_insns (); insn != 0; insn = NEXT_INSN (insn)) FOR_EACH_SUBINSN (subinsn, insn) if (USEFUL_INSN_P (subinsn)) - for_each_rtx (&PATTERN (subinsn), mips_record_lo_sum, &htab); + { + rtx body = PATTERN (insn); + int noperands = asm_noperands (body); + if (noperands >= 0) + { + rtx *ops = XALLOCAVEC (rtx, noperands); + bool *used = XALLOCAVEC (bool, noperands); + const char *string = decode_asm_operands (body, ops, NULL, NULL, + NULL, NULL); + get_referenced_operands (string, used, noperands); + for (int i = 0; i < noperands; ++i) + if (used[i]) + for_each_rtx (&ops[i], mips_record_lo_sum, &htab); + } + else + for_each_rtx (&PATTERN (subinsn), mips_record_lo_sum, &htab); + } last_insn = 0; hilo_delay = 2; |