]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
constraints.md: Change "Q" and "T" constraints to memory constraints.
authorJohn David Anglin <danglin@gcc.gnu.org>
Fri, 13 Feb 2015 13:09:58 +0000 (13:09 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 13 Feb 2015 13:09:58 +0000 (13:09 +0000)
* config/pa/constraints.md: Change "Q" and "T" constraints to memory
constraints.
* config/pa/pa.c (pa_cannot_force_const_mem): Don't allow constant
symbolic references to data to be forced to constant memory on the
SOM target.

From-SVN: r220681

gcc/ChangeLog
gcc/config/pa/constraints.md
gcc/config/pa/pa.c

index a826992f97b2646794aecd8db638a863c51f6552..e88869b6b25f3d7349ea735c8328f440a018ec72 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-13  John David Anglin  <danglin@gcc.gnu.org>
+
+       * config/pa/constraints.md: Change "Q" and "T" constraints to memory
+       constraints.
+       * config/pa/pa.c (pa_cannot_force_const_mem): Don't allow constant
+       symbolic references to data to be forced to constant memory on the
+       SOM target.
+
 2015-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index a9117b9889ed412e9ebcd90e9a7faa6e5d12bdb4..bfcba37346eb35ba0f56a85e2785636a29aea2d6 100644 (file)
   (and (match_code "mem")
        (match_test "IS_LO_SUM_DLT_ADDR_P (XEXP (op, 0))")))
 
-(define_constraint "Q"
+(define_memory_constraint "Q"
   "A memory operand that can be used as the destination operand of an
    integer store, or the source operand of an integer load.  That is
    any memory operand that isn't a symbolic, indexed or lo_sum memory
   (and (match_code "mem")
        (match_test "IS_INDEX_ADDR_P (XEXP (op, 0))")))
 
-(define_constraint "T"
+(define_memory_constraint "T"
   "A memory operand for floating-point loads and stores."
   (match_test "floating_point_store_memory_operand (op, mode)"))
 
index 8019820685180bba5ab331fc316a9b93738ae29f..d47de1c261b1dead56476e6d0834772df1172466 100644 (file)
@@ -1565,6 +1565,14 @@ pa_tls_referenced_p (rtx x)
 static bool
 pa_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
 {
+  /* Reload sometimes tries to put const data symbolic operands in
+     readonly memory.  The HP SOM linker doesn't allow symbolic data
+     in readonly memory.  */
+  if (TARGET_SOM
+      && !function_label_operand (x, VOIDmode)
+      && symbolic_operand (x, VOIDmode))
+    return true;
+
   return pa_tls_referenced_p (x);
 }