diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2008-07-18 15:42:59 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2008-07-18 08:42:59 -0700 |
commit | 5ae53a2559819d1628193d5a3d9257029ebe1fe7 (patch) | |
tree | 107bf1be24938ede6e18893d57c4b52f1a80f688 /gcc | |
parent | 0234a95444a38890d45228643948712d6f53f202 (diff) | |
download | gcc-5ae53a2559819d1628193d5a3d9257029ebe1fe7.zip gcc-5ae53a2559819d1628193d5a3d9257029ebe1fe7.tar.gz gcc-5ae53a2559819d1628193d5a3d9257029ebe1fe7.tar.bz2 |
re PR middle-end/36858 (Incorrect alignment attribute on stack parameter)
gcc/
2008-07-18 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/36858
* function.c (locate_and_pad_parm): Cap boundary earlier.
testsuite/
2008-07-18 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/36858
* gcc.target/i386/vararg-1.c: New.
From-SVN: r137954
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/function.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/vararg-1.c | 32 |
4 files changed, 44 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 41b5a49..0ff9b00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-07-18 H.J. Lu <hongjiu.lu@intel.com> + + PR middle-end/36858 + * function.c (locate_and_pad_parm): Cap boundary earlier. + 2008-07-17 Julian Brown <julian@codesourcery.com> * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Make diff --git a/gcc/function.c b/gcc/function.c index 69c2f68..ccf37a1 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3258,13 +3258,13 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs, = type ? size_in_bytes (type) : size_int (GET_MODE_SIZE (passed_mode)); where_pad = FUNCTION_ARG_PADDING (passed_mode, type); boundary = FUNCTION_ARG_BOUNDARY (passed_mode, type); + if (boundary > PREFERRED_STACK_BOUNDARY) + boundary = PREFERRED_STACK_BOUNDARY; locate->where_pad = where_pad; locate->boundary = boundary; /* Remember if the outgoing parameter requires extra alignment on the calling function side. */ - if (boundary > PREFERRED_STACK_BOUNDARY) - boundary = PREFERRED_STACK_BOUNDARY; if (crtl->stack_alignment_needed < boundary) crtl->stack_alignment_needed = boundary; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c48267..7cc31e80 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-18 H.J. Lu <hongjiu.lu@intel.com> + + PR middle-end/36858 + * gcc.target/i386/vararg-1.c: New. + 2008-07-18 Tobias Burnus <burnus@net-b.de> * gfortran.dg/parameter_array_init_4.f90: Silence pedantic warning. diff --git a/gcc/testsuite/gcc.target/i386/vararg-1.c b/gcc/testsuite/gcc.target/i386/vararg-1.c new file mode 100644 index 0000000..1875e0a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-1.c @@ -0,0 +1,32 @@ +/* PR middle-end/36858 */ +/* { dg-do run } */ +/* { dg-options "-w" { target { lp64 } } } */ +/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" { target { ilp32 } } } */ + +#include "sse2-check.h" +#include <stdarg.h> +#include <emmintrin.h> + +int +__attribute__((noinline)) +test (int a, ...) +{ + return a; +} + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; + +int +__attribute__((noinline)) +foo (void) +{ + return test (1, n1); +} + +static void +__attribute__((noinline)) +sse2_test (void) +{ + if (foo () != 1) + abort (); +} |