]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Get stack adjustment from push operand in pushsf splitter
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 24 Jan 2014 03:38:10 +0000 (03:38 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 24 Jan 2014 03:38:10 +0000 (19:38 -0800)
pushsf for -m64/-mx32 looks like

(set (mem:SF (pre_modify:SI (reg/f:SI 7 sp)
    (plus:SI (reg/f:SI 7 sp)
    (const_int -8))))
     (reg:SF 22 xmm1 [orig:84 D.1790 ] [84]))

Stack adjustment is in push operand and it isn't stack register mode size
which may be 4 bytes for -mx32.  This patch gets stack adjustment from
push operand if code of push isn't PRE_DEC.

gcc/

PR target/59929
* config/i386/i386.md (pushsf splitter): Get stack adjustment
from push operand if code of push isn't PRE_DEC.

gcc/testsuite/

PR target/59929
* gcc.target/i386/pr59929.c: New test.

From-SVN: r207023

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr59929.c [new file with mode: 0644]

index cd0e03d8647e116be30c9f78d5fdc9a8bad61de0..cdbedadc64cbb93764b553d2eff81a9b5f668c2e 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/59929
+       * config/i386/i386.md (pushsf splitter): Get stack adjustment
+       from push operand if code of push isn't PRE_DEC.
+
 2014-01-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/59909
index ddc3be67c65c87ea09695f3fb223bf0a545b9c4c..92e8fd0144cf22ead7cf60cd8a3f11e9644ba0dd 100644 (file)
   "reload_completed"
   [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2)))
    (set (mem:SF (reg:P SP_REG)) (match_dup 1))]
-  "operands[2] = GEN_INT (-<P:MODE_SIZE>);")
+{
+  rtx op = XEXP (operands[0], 0);
+  if (GET_CODE (op) == PRE_DEC)
+    {
+      gcc_assert (!TARGET_64BIT);
+      op = GEN_INT (-4);
+    }
+  else
+    {
+      op = XEXP (XEXP (op, 1), 1);
+      gcc_assert (CONST_INT_P (op));
+    }
+  operands[2] = op;
+})
 
 (define_split
   [(set (match_operand:SF 0 "push_operand")
index 1240250b7b816c74aee0ffb89790559466c445f6..91c06d50f3ea24766f8596cff5393d2ebfb9ecea 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/59929
+       * gcc.target/i386/pr59929.c: New test.
+
 2014-01-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/59909
diff --git a/gcc/testsuite/gcc.target/i386/pr59929.c b/gcc/testsuite/gcc.target/i386/pr59929.c
new file mode 100644 (file)
index 0000000..4591dc4
--- /dev/null
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mno-accumulate-outgoing-args" } */
+/* { dg-options "-O0 -mno-accumulate-outgoing-args -mx32 -maddress-mode=short" { target x32 } } */
+
+void
+__attribute__ ((noinline))
+test (float x1, float x2, float x3, float x4, float x5, float x6,
+      float x7, float x8, float x9, float x10, float x11, float x12,
+      float x13, float x14, float x15, float x16)
+{
+  if (x1 != 91
+      || x2 != 92
+      || x3 != 93
+      || x4 != 94
+      || x5 != 95
+      || x6 != 96
+      || x7 != 97
+      || x8 != 98
+      || x9 != 99
+      || x10 != 100
+      || x11 != 101
+      || x12 != 102
+      || x13 != 103
+      || x14 != 104
+      || x15 != 105
+      || x16 != 106)
+    __builtin_abort ();
+}
+
+float x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13,
+      x14, x15, x16;
+
+int
+main ()
+{
+  x1 = 91;
+  x2 = 92;
+  x3 = 93;
+  x4 = 94;
+  x5 = 95;
+  x6 = 96;
+  x7 = 97;
+  x8 = 98;
+  x9 = 99;
+  x10 = 100;
+  x11 = 101;
+  x12 = 102;
+  x13 = 103;
+  x14 = 104;
+  x15 = 105;
+  x16 = 106;
+  test (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13,
+       x14, x15, x16);
+  return 0;
+}