Commit f85882d8 by Joey Ye Committed by H.J. Lu

re PR target/39146 (Unnecessary stack alignment)

gcc/

2009-06-12  Joey Ye  <joey.ye@intel.com>

	PR middle-end/39146
	* cfgexpand.c (get_decl_align_unit): Update
	max_used_stack_slot_alignment with align instead of
	stack_alignment_needed.

	* function.c (assign_stack_local_1): Update
	max_used_stack_slot_alignment with alignment_in_bits instead
	of stack_alignment_needed.
	(locate_and_pad_parm): Don't update max_used_stack_slot_alignment
	here.

gcc/testsuite/

2009-06-12  Joey Ye  <joey.ye@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/39146
	* gcc.target/i386/stackalign/pr39146.c: New.

From-SVN: r148428
parent fc9f468b
2009-06-12 Joey Ye <joey.ye@intel.com>
PR middle-end/39146
* cfgexpand.c (get_decl_align_unit): Update
max_used_stack_slot_alignment with align instead of
stack_alignment_needed.
* function.c (assign_stack_local_1): Update
max_used_stack_slot_alignment with alignment_in_bits instead
of stack_alignment_needed.
(locate_and_pad_parm): Don't update max_used_stack_slot_alignment
here.
2009-06-12 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (last_var_location_insn): New variable.
......@@ -8,7 +21,7 @@
2009-06-11 Richard Henderson <rth@redhat.com>
* alpha.c (alpha_expand_prologue): Add a REF_CFA_REGISTER
* alpha.c (alpha_expand_prologue): Add a REF_CFA_REGISTER
note when storing the frame pointer in a register.
(FRP): Don't redefine to nothing for epilogue.
(alpha_expand_epilogue): Mark register and sp restores.
......
......@@ -564,8 +564,8 @@ get_decl_align_unit (tree decl)
So here we only make sure stack_alignment_needed >= align. */
if (crtl->stack_alignment_needed < align)
crtl->stack_alignment_needed = align;
if (crtl->max_used_stack_slot_alignment < crtl->stack_alignment_needed)
crtl->max_used_stack_slot_alignment = crtl->stack_alignment_needed;
if (crtl->max_used_stack_slot_alignment < align)
crtl->max_used_stack_slot_alignment = align;
return align / BITS_PER_UNIT;
}
......
......@@ -355,8 +355,8 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size,
if (crtl->stack_alignment_needed < alignment_in_bits)
crtl->stack_alignment_needed = alignment_in_bits;
if (crtl->max_used_stack_slot_alignment < crtl->stack_alignment_needed)
crtl->max_used_stack_slot_alignment = crtl->stack_alignment_needed;
if (crtl->max_used_stack_slot_alignment < alignment_in_bits)
crtl->max_used_stack_slot_alignment = alignment_in_bits;
/* Calculate how many bytes the start of local variables is off from
stack alignment. */
......@@ -3520,8 +3520,6 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
calling function side. */
if (crtl->stack_alignment_needed < boundary)
crtl->stack_alignment_needed = boundary;
if (crtl->max_used_stack_slot_alignment < crtl->stack_alignment_needed)
crtl->max_used_stack_slot_alignment = crtl->stack_alignment_needed;
if (crtl->preferred_stack_boundary < boundary)
crtl->preferred_stack_boundary = boundary;
......
2009-06-12 Joey Ye <joey.ye@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/39146
* gcc.target/i386/stackalign/pr39146.c: New.
2009-06-11 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/crc32-1.c: New.
......
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -mavx" } */
typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__));
__m256i
bar (__m256i x)
{
return x;
}
/* { dg-final { scan-assembler-not "and\[lq\]?\[^\\n\]*-32,\[^\\n\]*sp" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment