------- Comment #4 from jakub at gcc dot gnu dot org 2008-12-02 17:46 ------- This is a dup of PR38245, again, DCE removes the only call in the function, but not the argument push, so that push clobbers slot where caller's %ebx is preserved.
Either: --- config/i386/i386.c.i386 2008-11-27 17:08:28.000000000 +0100 +++ config/i386/i386.c 2008-12-02 18:26:24.000000000 +0100 @@ -7566,14 +7566,8 @@ ix86_compute_frame_layout (struct ix86_f offset += size; - /* Add outgoing arguments area. Can be skipped if we eliminated - all the function calls as dead code. - Skipping is however impossible when function calls alloca. Alloca - expander assumes that last crtl->outgoing_args_size - of stack frame are unused. */ - if (ACCUMULATE_OUTGOING_ARGS - && (!current_function_is_leaf || cfun->calls_alloca - || ix86_current_function_calls_tls_descriptor)) + /* Add outgoing arguments area. */ + if (ACCUMULATE_OUTGOING_ARGS) { offset += crtl->outgoing_args_size; frame->outgoing_arguments_size = crtl->outgoing_args_size; fixes this (and other targets would need to be checked for this too), or DCE needs to be taught to remove also the arguments (if that is at all possible, for ACCUMULATE_OUTGOING_ARGS that shouldn't be that hard, but for -mno-accumulate-outgoing-args it would be much harder). *** This bug has been marked as a duplicate of 38245 *** -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38364