Use Pmode with stack_pointer_rtx
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 7 Nov 2013 09:58:05 +0000 (09:58 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 7 Nov 2013 09:58:05 +0000 (01:58 -0800)
gcc/

PR target/59034
* config/i386/i386.md (push peepholer/splitter): Use Pmode
with stack_pointer_rtx.

gcc/testsuite/

PR target/59034
* gcc.target/i386/pr59034-1.c: New test.
* gcc.target/i386/pr59034-2.c: Likewise.

From-SVN: r204501

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr59034-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr59034-2.c [new file with mode: 0644]

index 89ce097..4991a3a 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/59034
+       * config/i386/i386.md (push peepholer/splitter): Use Pmode
+       with stack_pointer_rtx.
+
 2013-11-07  Bin Cheng  <bin.cheng@arm.com>
 
        * tree-ssa-loop-ivopts.c (get_shiftadd_cost): Check equality
index c7ec0c1..a2c81e5 100644 (file)
   split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]);
 
   operands[1] = gen_lowpart (DImode, operands[2]);
-  operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx,
+  operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx,
                                                   GEN_INT (4)));
 })
 
   split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]);
 
   operands[1] = gen_lowpart (DImode, operands[2]);
-  operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx,
+  operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx,
                                                   GEN_INT (4)));
 })
 
index c89765b..56d30a3 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/59034
+       * gcc.target/i386/pr59034-1.c: New test.
+       * gcc.target/i386/pr59034-2.c: Likewise.
+
 2013-11-07  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.dg/tree-ssa/loop-2.c: Refine check condition.
diff --git a/gcc/testsuite/gcc.target/i386/pr59034-1.c b/gcc/testsuite/gcc.target/i386/pr59034-1.c
new file mode 100644 (file)
index 0000000..1f4c4e0
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-require-effective-target maybe_x32 } */
+/* { dg-options "-O -mx32 -mtune=corei7 -maddress-mode=short" } */
+
+extern int foo(int, ...);
+int bar(void) {
+  long double l = 1.2345E6;
+  foo(0, l);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr59034-2.c b/gcc/testsuite/gcc.target/i386/pr59034-2.c
new file mode 100644 (file)
index 0000000..14e594b
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-require-effective-target maybe_x32 } */
+/* { dg-options "-O -mx32 -mtune=corei7 -maddress-mode=long" } */
+
+extern int foo(int, ...);
+int bar(void) {
+  long double l = 1.2345E6;
+  foo(0, l);
+  return 0;
+}