mep.md (eh_epilogue): Defer until after epilogue is emitted.
authorDJ Delorie <dj@redhat.com>
Fri, 11 Sep 2009 01:06:36 +0000 (21:06 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Fri, 11 Sep 2009 01:06:36 +0000 (21:06 -0400)
* config/mep/mep.md (eh_epilogue): Defer until after epilogue is
emitted.

* config/mep/mep.h (LEGITIMATE_CONSTANT_P): New.
* config/mep/mep.c (mep_legitimate_constant_p): New.
* config/mep/mep-protos.h: Prototype it.

From-SVN: r151625

gcc/ChangeLog
gcc/config/mep/mep-protos.h
gcc/config/mep/mep.c
gcc/config/mep/mep.h
gcc/config/mep/mep.md

index f5724f51a10792aa4b892a59d3172c8d958884e4..64b946a4a1b850085be2ae5d8914c38e0dd4e681 100644 (file)
@@ -1,3 +1,12 @@
+2009-09-10  DJ Delorie  <dj@redhat.com>
+
+       * config/mep/mep.md (eh_epilogue): Defer until after epilogue is
+       emitted.
+
+       * config/mep/mep.h (LEGITIMATE_CONSTANT_P): New.
+       * config/mep/mep.c (mep_legitimate_constant_p): New.
+       * config/mep/mep-protos.h: Prototype it.
+
 2009-09-10  Richard Henderson  <rth@redhat.com>
 
        * print-rtl.c (print_rtx): Fix JUMP_LABEL index.
index a4de754bbd9a4d72d38ca384a6a42f66339c60d7..e53ca79639c1f87a9e6520d1f1a71222ae9e12b8 100644 (file)
@@ -48,6 +48,7 @@ extern void mep_split_wide_move (rtx *, enum machine_mode);
 #ifdef RTX_CODE
 extern bool mep_expand_setcc (rtx *);
 extern rtx mep_expand_cbranch (rtx *);
+extern bool mep_legitimate_constant_p (rtx);
 #endif
 extern const char *mep_emit_cbranch (rtx *, int);
 extern void mep_expand_call (rtx *, int);
index 80d39956b7b762abd969d09475764b363558b3b4..6ff6405c571b55c28659fa3ec48b1e13e95fd9b2 100644 (file)
@@ -1211,6 +1211,20 @@ mep_multi_slot (rtx x)
 }
 
 
+bool
+mep_legitimate_constant_p (rtx x)
+{
+  /* We can't convert symbol values to gp- or tp-rel values after
+     reload, as reload might have used $gp or $tp for other
+     purposes.  */
+  if (GET_CODE (x) == SYMBOL_REF && (reload_in_progress || reload_completed))
+    {
+      char e = mep_section_tag (x);
+      return (e != 't' && e != 'b');
+    }
+  return 1;
+}
+
 /* Be careful not to use macros that need to be compiled one way for
    strict, and another way for not-strict, like REG_OK_FOR_BASE_P.  */
 
index cb09c308d500d06f610e16fd0a20131b0eec231c..39837dfc329fd300693a9ec1a380ba8d22de6f5f 100644 (file)
@@ -599,7 +599,8 @@ typedef struct
 
 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
 
-#define LEGITIMATE_CONSTANT_P(X) 1
+#define LEGITIMATE_CONSTANT_P(X) \
+  mep_legitimate_constant_p(X)
 
 #define SELECT_CC_MODE(OP, X, Y)  CCmode
 \f
index 20beef6b4381b85bde823194bdafe5716190a784..773a9a0aa1418cf1791e95c0d2e87f653b7965bc 100644 (file)
    (use (reg:SI LP_REGNO))]
   ""
   "#"
-  "reload_completed"
+  "epilogue_completed"
   [(const_int 1)]
   "mep_emit_eh_epilogue (operands); DONE;"
   [(set_attr "slot" "multi")])