public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [fr30] Fix indirect_jump pattern
@ 2015-07-16 14:19 Richard Sandiford
  2015-07-23 22:00 ` Ping: " Richard Sandiford
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2015-07-16 14:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: nickc

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")]
 )

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Ping: [fr30] Fix indirect_jump pattern
  2015-07-16 14:19 [fr30] Fix indirect_jump pattern Richard Sandiford
@ 2015-07-23 22:00 ` Richard Sandiford
  2015-07-24  5:55   ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2015-07-23 22:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: nickc

Ping

Richard Sandiford <richard.sandiford@arm.com> 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")]
>  )

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ping: [fr30] Fix indirect_jump pattern
  2015-07-23 22:00 ` Ping: " Richard Sandiford
@ 2015-07-24  5:55   ` Jeff Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Law @ 2015-07-24  5:55 UTC (permalink / raw)
  To: gcc-patches, nickc, rdsandiford

On 07/23/2015 03:28 PM, Richard Sandiford wrote:
> Ping
>
> Richard Sandiford <richard.sandiford@arm.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-24  5:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-16 14:19 [fr30] Fix indirect_jump pattern Richard Sandiford
2015-07-23 22:00 ` Ping: " Richard Sandiford
2015-07-24  5:55   ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).