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
This commit is contained in:
H.J. Lu 2008-07-18 15:42:59 +00:00 committed by H.J. Lu
parent 0234a95444
commit 5ae53a2559
4 changed files with 44 additions and 2 deletions

View file

@ -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

View file

@ -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;

View file

@ -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.

View file

@ -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 ();
}