diff mbox

PATCH: PR target/59034: FAIL gcc.c-torture/compile/20031208-1.c

Message ID 20131107061939.GA25084@intel.com
State New
Headers show

Commit Message

H.J. Lu Nov. 7, 2013, 6:19 a.m. UTC
Hi,

We should use Pmode with stack_pointer_rtx.  OK for trunk and 4.8
branch?

Thanks.

H.J.
---
gcc/

2013-11-06  H.J. Lu  <hongjiu.lu@intel.com>

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

gcc/testsuite/

2013-11-06  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.

Comments

Uros Bizjak Nov. 7, 2013, 7:42 a.m. UTC | #1
On Thu, Nov 7, 2013 at 7:19 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> We should use Pmode with stack_pointer_rtx.  OK for trunk and 4.8
> branch?

OK everywhere.

Thanks,
Uros.
H.J. Lu Nov. 7, 2013, 10:13 a.m. UTC | #2
On Wed, Nov 6, 2013 at 11:42 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Nov 7, 2013 at 7:19 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>
>> We should use Pmode with stack_pointer_rtx.  OK for trunk and 4.8
>> branch?
>
> OK everywhere.
>

I checked it into trunk and 4.8 branch.  For 4.7, I only checked
in the i386.md change since the testcases use the new
-maddress-mode= in 4.8.

Thanks.
diff mbox

Patch

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index c7ec0c1..a2c81e5 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1669,7 +1669,7 @@ 
   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)));
 })
 
@@ -1686,7 +1686,7 @@ 
   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)));
 })
 
diff --git a/gcc/testsuite/gcc.target/i386/pr59034-1.c b/gcc/testsuite/gcc.target/i386/pr59034-1.c
new file mode 100644
index 0000000..1f4c4e0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr59034-1.c
@@ -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
index 0000000..14e594b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr59034-2.c
@@ -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;
+}