From: Richard Henderson Date: Wed, 4 Aug 2010 23:57:56 +0000 (-0700) Subject: Simplify logic saving the int registers in the prologue. X-Git-Tag: releases/gcc-4.6.0~5249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdcb5f261ea31ae5e27aa618a643765a6f9873d8;p=thirdparty%2Fgcc.git Simplify logic saving the int registers in the prologue. From-SVN: r162884 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1cc2118c1162..1d0a11666263 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2010-08-04 Richard Henderson + * config/i386/i386.c (ix86_expand_prologue): Simplify logic + saving the int registers. + * dwarf2out.c: Remove most of the DWARF2_DEBUGGING_INFO and DWARF2_UNWIND_INFO conditional compilation. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6d676b22ad22..4be3bfc5157e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9194,6 +9194,7 @@ ix86_expand_prologue (void) struct ix86_frame frame; HOST_WIDE_INT allocate; int gen_frame_pointer = frame_pointer_needed; + bool int_registers_saved = false; ix86_finalize_stack_realign_flags (); @@ -9347,7 +9348,10 @@ ix86_expand_prologue (void) allocate = frame.to_allocate + frame.nsseregs * 16 + frame.padding0; if (!frame.save_regs_using_mov) - ix86_emit_save_regs (); + { + ix86_emit_save_regs (); + int_registers_saved = true; + } else allocate += frame.nregs * UNITS_PER_WORD; @@ -9356,7 +9360,7 @@ ix86_expand_prologue (void) if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) { /* We expect the registers to be saved when probes are used. */ - gcc_assert (!frame.save_regs_using_mov); + gcc_assert (int_registers_saved); if (STACK_CHECK_MOVING_SP) { @@ -9382,13 +9386,17 @@ ix86_expand_prologue (void) avoid doing this if I am going to have to probe the stack since at least on x86_64 the stack probe can turn into a call that clobbers a red zone location */ - if (!TARGET_64BIT_MS_ABI && TARGET_RED_ZONE && frame.save_regs_using_mov + if (!int_registers_saved + && (TARGET_RED_ZONE && !TARGET_64BIT_MS_ABI) && (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT)) - ix86_emit_save_regs_using_mov ((frame_pointer_needed - && !crtl->stack_realign_needed) - ? hard_frame_pointer_rtx - : stack_pointer_rtx, - -frame.nregs * UNITS_PER_WORD); + { + ix86_emit_save_regs_using_mov ((frame_pointer_needed + && !crtl->stack_realign_needed) + ? hard_frame_pointer_rtx + : stack_pointer_rtx, + -frame.nregs * UNITS_PER_WORD); + int_registers_saved = true; + } if (allocate == 0) ; @@ -9439,9 +9447,7 @@ ix86_expand_prologue (void) } } - if (frame.save_regs_using_mov - && !(!TARGET_64BIT_MS_ABI && TARGET_RED_ZONE - && (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT))) + if (!int_registers_saved) { if (!frame_pointer_needed || !(frame.to_allocate + frame.padding0)