https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69677
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #7)
> Created attachment 37584 [details]
> gcc6-pr69677.patch
>
> I'm currently bootstrapping/regtesting --with-arch=corei7 --with-cpu=corei7
> --with-fpmath=sse i686-linux compiler with this patch, and got already well
> past the spot where it previously ICEd.
> The patch should restore STV behavior to the previous one, except for the
> non-default lower preferred/incoming stack boundaries.
This is wrong and I don't think it is needed. Assert
crtl->stack_alignment_needed >= 128
is OK. Change it isn't allowed after rtl->stack_realign_processed is set.
@@ -3588,6 +3588,16 @@ convert_scalars_to_vector ()
bitmap_obstack_release (NULL);
df_process_deferred_rescans ();
+ /* Conversion means we may have 128bit register spills/fills
+ which require aligned stack. */
+ if (converted_insns)
+ {
+ if (crtl->stack_alignment_needed < 128)
+ crtl->stack_alignment_needed = 128;
+ if (crtl->stack_alignment_estimated < 128)
+ crtl->stack_alignment_estimated = 128;
+ }
+
return 0;
}