]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
msp430.md (call_internal): Don't allow memory references with SP as the base register.
authorDJ Delorie <dj@redhat.com>
Mon, 13 Jan 2014 19:17:45 +0000 (14:17 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Mon, 13 Jan 2014 19:17:45 +0000 (14:17 -0500)
* config/msp430/msp430.md (call_internal): Don't allow memory
references with SP as the base register.
(call_value_internal): Likewise.
* config/msp430/constraints.md (Yc): New.  For memory references
that don't use SP as a base register.

* config/msp430/msp430.c (msp430_print_operand): Add 'J' to mean
"an integer without a # prefix"
* config/msp430/msp430.md (epilogue_helper): Use it.

From-SVN: r206586

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

index 15697e5a9c7438e85653a86275ba627a9bce91a2..5c674bc5b4438d789ea3d1ba4b769d3a129877cd 100644 (file)
@@ -1,3 +1,15 @@
+2014-01-10  DJ Delorie  <dj@redhat.com>
+
+       * config/msp430/msp430.md (call_internal): Don't allow memory
+       references with SP as the base register.
+       (call_value_internal): Likewise.
+       * config/msp430/constraints.md (Yc): New.  For memory references
+       that don't use SP as a base register.
+
+       * config/msp430/msp430.c (msp430_print_operand): Add 'J' to mean
+       "an integer without a # prefix"
+       * config/msp430/msp430.md (epilogue_helper): Use it.
+
 2014-01-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/59617
index 5b1ff4a6a3335ac2bff881c82add84f141b9dcfb..8ab057fd1c93ff9b67bdb703202606ce36b266f8 100644 (file)
                  (match_test ("IN_RANGE (INTVAL (XEXP (XEXP (op, 0), 1)), -1 << 15, (1 << 15)-1)"))))
        (match_code "reg" "0")
        )))
+
+(define_constraint "Yc"
+  "Memory reference, for CALL - we can't use SP"
+  (and (match_code "mem")
+       (match_code "mem" "0")
+       (not (ior
+            (and (match_code "plus" "00")
+                 (and (match_code "reg" "000")
+                      (match_test ("REGNO (XEXP (XEXP (op, 0), 0)) != SP_REGNO"))))
+            (and (match_code "reg" "0")
+                 (match_test ("REGNO (XEXP (XEXP (op, 0), 0)) != SP_REGNO")))
+            ))))
+
index 39e2d312377f4f0e036d16f5c679fc55a374a0f3..d49b9a463743bc2b6e780e70188b1e6ec6114bb2 100644 (file)
@@ -1920,6 +1920,7 @@ msp430_print_operand_addr (FILE * file, rtx addr)
    D   bits 48-63 of a 64-bit value/reg 4 of a DImode value
    H   like %B (for backwards compatibility)
    I   inverse of value
+   J   an integer without a # prefix
    L   like %A (for backwards compatibility)
    O   offset of the top of the stack
    Q   like X but generates an A postfix
@@ -1950,7 +1951,6 @@ msp430_print_operand (FILE * file, rtx op, int letter)
       /* Print the constant value, less four.  */
       fprintf (file, "#%ld", INTVAL (op) - 4);
       return;
-      /* case 'D': used for "decimal without '#'" */
     case 'I':
       if (GET_CODE (op) == CONST_INT)
        {
@@ -2110,6 +2110,8 @@ msp430_print_operand (FILE * file, rtx op, int letter)
                - 2);
       return;
 
+    case 'J':
+      gcc_assert (GET_CODE (op) == CONST_INT);
     case 0:
       break;
     default:
index eea4da098d978d5ef248918fdc97961f8f58d253..6a40fd9e2925b6894ff1ee07b154243aa900c83b 100644 (file)
 (define_insn "epilogue_helper"
   [(unspec_volatile [(match_operand 0 "immediate_operand" "i")] UNS_EPILOGUE_HELPER)]
   ""
-  "BR%Q0\t#__mspabi_func_epilog_%0"
+  "BR%Q0\t#__mspabi_func_epilog_%J0"
   )
 
 
 )
 
 (define_insn "call_internal"
-  [(call (mem:HI (match_operand 0 "general_operand" "rmi"))
+  [(call (mem:HI (match_operand 0 "general_operand" "rYci"))
         (match_operand 1 ""))]
   ""
   "CALL%Q0\t%0"
 
 (define_insn "call_value_internal"
   [(set (match_operand               0 "register_operand" "=r")
-       (call (mem:HI (match_operand 1 "general_operand" "rmi"))
+       (call (mem:HI (match_operand 1 "general_operand" "rYci"))
              (match_operand 2 "")))]
   ""
   "CALL%Q0\t%1"