------- Comment #26 from hubicka at gcc dot gnu dot org 2009-02-21 13:00 ------- I had somehting along this lines in mind: Index: config/i386/i386.c =================================================================== *** config/i386/i386.c (revision 144352) --- config/i386/i386.c (working copy) *************** unsigned int *** 19332,19337 **** --- 19332,19343 ---- ix86_local_alignment (tree type, enum machine_mode mode, unsigned int align) { + /* We don't want to align DImode to 64bit for compilation with + -mpreferred-stack-boundary=2 to not enforce dynamic stack alignment + prologue. */ + if (mode == DImode && !TARGET_64BIT && ix86_preferred_stack_boundary < 64) + align = 32; + /* If TYPE is NULL, we are allocating a stack slot for caller-save register in MODE. We will return the largest alignment of XF and DF. */
this will reduce alignment of long long as stack local variable. Because we want to keep it aligned for DI->DF, I can do that only for -mpreferred-stack-boundary=2 for now and perhaps on mainline we can invent new macro PREFERRED_LOCAL_ALIGN that will return 64 and cfgexpand will allocate 64byte aligned slot but not increase alignment_needed (i.e. control slot alignment via PREFERRED_LOCAL_ALIGN and stack alignment otherwise) and we will increase the alignment when expanding full sized DImode instruction? Honza -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137