Patchwork Commit: RX: Add return pattern

login
register
mail settings
Submitter Nick Clifton
Date Jan. 11, 2012, 11:39 a.m.
Message ID <871ur6h3j6.fsf@redhat.com>
Download mbox | patch
Permalink /patch/135378/
State New
Headers show

Comments

Nick Clifton - Jan. 11, 2012, 11:39 a.m.
Hi Guys,

  I am checking in the patch below to fix a problem building the RX
  port.  Targets that define the "simple_return" pattern must also
  define a "return" pattern.  Otherwise gcc/function.c will fail to
  build.

Cheers
  Nick

gcc/ChangeLog
2012-01-11  Nick Clifton  <nickc@redhat.com>

	* config/rx/rx.md (return): Define pattern.
Richard Henderson - Jan. 12, 2012, 4:29 a.m.
On 01/11/2012 10:39 PM, Nick Clifton wrote:
> +(define_expand "return"
> +  [(return)]
> +  ""
> +  "rx_expand_epilogue (false); DONE;"
> +)

Not an ideal solution, since the availability of this pattern implies
it's extremely cheap, and we'll replace jumps to the epilogue with
this pattern.

A hack-around might be

(define_expand "return"
  [(return)]
  "false"
  { gcc_unreachable (); })

Or to define an availability predicate similar to i386, testing if
the epilogue is trivial, and only a return insn is needed.


r~

Patch

Index: gcc/config/rx/rx.md
===================================================================
--- gcc/config/rx/rx.md	(revision 183092)
+++ gcc/config/rx/rx.md	(working copy)
@@ -340,6 +340,12 @@ 
    (set_attr "length" "2")]
 )
 
+(define_expand "return"
+  [(return)]
+  ""
+  "rx_expand_epilogue (false); DONE;"
+)
+
 (define_insn "simple_return"
   [(return)]
   ""