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...@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...@intel.com> PR target/59034 * gcc.target/i386/pr59034-1.c: New test. * gcc.target/i386/pr59034-2.c: Likewise. 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; +}