Committed the attached change to trunk and 4.7 after testing on hppa- unknown-linux-gnu.
Working on a revised change for 4.6.

I don't think symbol + constant can occur but I'm not absolutely sure.

On 2-Jan-13, at 8:12 AM, Richard Sandiford wrote:

In any case, reload needs to know up-front that the constant can't be
rematerialised, via LEGITIMATE_CONSTANT_P.  emit_move_insn_1 would be
too late.  It looks like PA already handles this for some TLS models:

 /* TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC are not
    legitimate constants.  */
 if (PA_SYMBOL_REF_TLS_P (x))
  {
    enum tls_model model = SYMBOL_REF_TLS_MODEL (x);

if (model == TLS_MODEL_GLOBAL_DYNAMIC || model == TLS_MODEL_LOCAL_DYNAMIC)
      return false;
  }

so maybe that should just be:

 if (PA_SYMBOL_REF_TLS_P (x))
   return false;


Dave
--
John David Anglin       dave.ang...@bell.net

2013-01-03  John David Anglin  <dave.ang...@nrc-cnrc.gc.ca>

        PR target/53789
        * config/pa/pa.md (movsi): Revert previous change.
        * config/pa/pa.c (pa_legitimate_constant_p): Reject all TLS symbol
        references.

Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md     (revision 194824)
+++ config/pa/pa.md     (working copy)
@@ -2094,12 +2155,6 @@
   ""
   "
 {
-  /* A TLS symbol reference is not a valid move source operand.
-     pa_emit_move_sequence can only handle them prior to reload.
-     There is also no way to reload a TLS symbol reference, so
-     we must reject them after reload starts.  */
-  if (PA_SYMBOL_REF_TLS_P (operands[1]) && !can_create_pseudo_p ())
-    FAIL;
   if (pa_emit_move_sequence (operands, SImode, 0))
     DONE;
 }")
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c      (revision 194824)
+++ config/pa/pa.c      (working copy)
@@ -10358,15 +10358,11 @@
     return false;
 
   /* TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC are not
-     legitimate constants.  */
+     legitimate constants.  The other variants can't be handled by
+     the move patterns after reload starts.  */
   if (PA_SYMBOL_REF_TLS_P (x))
-   {
-     enum tls_model model = SYMBOL_REF_TLS_MODEL (x);
+    return false;
 
-     if (model == TLS_MODEL_GLOBAL_DYNAMIC || model == TLS_MODEL_LOCAL_DYNAMIC)
-       return false;
-   }
-
   if (TARGET_64BIT && GET_CODE (x) == CONST_DOUBLE)
     return false;
 





Reply via email to