From 7951924dcde91db28a330abb7e155d83cf7aa8f4 Mon Sep 17 00:00:00 2001 From: hjl Date: Fri, 18 Jul 2008 15:42:59 +0000 Subject: [PATCH] gcc/ 2008-07-18 H.J. Lu PR middle-end/36858 * function.c (locate_and_pad_parm): Cap boundary earlier. testsuite/ 2008-07-18 H.J. Lu PR middle-end/36858 * gcc.target/i386/vararg-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137954 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/function.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/vararg-1.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/vararg-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 41b5a4924e7..0ff9b006c95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-07-18 H.J. Lu + + PR middle-end/36858 + * function.c (locate_and_pad_parm): Cap boundary earlier. + 2008-07-17 Julian Brown * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Make diff --git a/gcc/function.c b/gcc/function.c index 69c2f68a4f9..ccf37a1aad2 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 5c48267b5fa..7cc31e80f4e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-18 H.J. Lu + + PR middle-end/36858 + * gcc.target/i386/vararg-1.c: New. + 2008-07-18 Tobias Burnus * 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 00000000000..1875e0a6973 --- /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 +#include + +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 (); +} -- 2.11.0