This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow preferred-stack-boundary of 3 for x86-64
>
> I tested the patch now and I get a ICE while compiling the x86_64 linux kernel
> with -mpreferred-stack-boundary=3 and 070727 SVN checkout + patch
>
> /home/lsrc/quilt/linux/init/do_mounts.c: In function 'change_floppy':
> /home/lsrc/quilt/linux/init/do_mounts.c:390: internal compiler error: in ix86_compute_frame_layout, at config/i386/i386.c:5745
Hi,
this patch should fix it, I will commit it after testing on
x86_64-linux.
Honza
* i386.c (setup_incoming_varargs_64): Tolerate 64bit preferred
stack boundary.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 127065)
+++ config/i386/i386.c (working copy)
@@ -4656,7 +4656,14 @@ setup_incoming_varargs_64 (CUMULATIVE_AR
/* Indicate to allocate space on the stack for varargs save area. */
ix86_save_varrargs_registers = 1;
- cfun->stack_alignment_needed = 128;
+ /* We need 16-byte stack alignment to save SSE registers. If user
+ asked for lower preferred_stack_boundary, lets just hope that he knows
+ what he is doing and won't varargs SSE values.
+
+ We also may end up assuming that only 64bit values are stored in SSE
+ register let some floating point program work. */
+ if (ix86_preferred_stack_boundary >= 128)
+ cfun->stack_alignment_needed = 128;
save_area = frame_pointer_rtx;
set = get_varargs_alias_set ();