http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57932
Markus Eisenmann <meisenmann....@fh-salzburg.ac.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|IA-32/x86-64 |i386 --- Comment #1 from Markus Eisenmann <meisenmann....@fh-salzburg.ac.at> --- After further investigations within [gcc-4.6.4\]gcc\config\i386\i386.c I have found (maybe) the issue: Within function ix86_compute_frame_layout there are 2 stack-realignments: a) the local stack is aligned first, w/o including stack-needs (see b afterwards) /* Align start of frame for local function. */ if (stack_realign_fp || offset != frame->sse_reg_save_offset || size != 0 || !current_function_is_leaf || cfun->calls_alloca || ix86_current_function_calls_tls_descriptor) offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed; b) after that a second re-calculation takes place, including the size of alloca/pushed args/sub-calls: offset += size; ... /* Align stack boundary. Only needed if we're calling another function or using alloca. */ if (!current_function_is_leaf || cfun->calls_alloca || ix86_current_function_calls_tls_descriptor) offset = (offset + preferred_alignment - 1) & -preferred_alignment; Based on my understanding - the waste/gap of stack includes a) and b) together. In my opinion - if stack_alignment_needed == preferred_alignment the first alignment isn't nedded; I.e. a) is already included by b) At leats, are there an further comments to my findings ... ?