This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fr30] Fix indirect_jump pattern
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: nickc at redhat dot com
- Date: Thu, 16 Jul 2015 15:14:30 +0100
- Subject: [fr30] Fix indirect_jump pattern
- Authentication-results: sourceware.org; auth=none
The pattern was accepting a nonimediate_operand, using the C condition
to weed out certain types of memory, but was then using an "r" constraint
to force a register. This patch makes the predicate match the constraint
and removes the C condition.
Tested by building fr30-elf and using:
int
foo (int i)
{
__typeof(&&a) foo[] = { &&a, &&a, &&b, &&c };
restart:
goto *foo[i];
a:
return 1;
b:
i += 1;
goto restart;
c:
return 2;
}
to triger an indirect jump (checked via -dp). OK to install?
Thanks,
Richard
gcc/
* config/fr30/fr30.md (indirect_jump): Use pmode_register_operand
instead of nonimmediate_operand. Remove C condiition.
Index: gcc/config/fr30/fr30.md
===================================================================
--- gcc/config/fr30/fr30.md 2015-06-22 14:02:15.165532334 +0100
+++ gcc/config/fr30/fr30.md 2015-07-13 19:31:50.552692732 +0100
@@ -1146,8 +1146,8 @@ (define_insn "jump"
;; Indirect jump through a register
(define_insn "indirect_jump"
- [(set (pc) (match_operand:SI 0 "nonimmediate_operand" "r"))]
- "GET_CODE (operands[0]) != MEM || GET_CODE (XEXP (operands[0], 0)) != PLUS"
+ [(set (pc) (match_operand 0 "pmode_register_operand" "r"))]
+ ""
"jmp%#\\t@%0"
[(set_attr "delay_type" "delayed")]
)