Re: Ping: [fr30] Fix indirect_jump pattern

2015-07-23 Thread Jeff Law

On 07/23/2015 03:28 PM, Richard Sandiford wrote:

Ping

Richard Sandiford  writes:

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.

OK.

Jeff



Ping: [fr30] Fix indirect_jump pattern

2015-07-23 Thread Richard Sandiford
Ping

Richard Sandiford  writes:
> 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")]
>  )


[fr30] Fix indirect_jump pattern

2015-07-16 Thread Richard Sandiford
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")]
 )