Commit dbf9ee15 by Uros Bizjak

re PR target/39118 (x86_64 red zone violation)

	PR target/39118
	* config/i386/i386.c (expand_prologue): Emit blockage at the end
	of function prologue when frame pointer is used to access
	red zone area.

From-SVN: r144063
parent f76f0edd
2009-02-10 Uros Bizjak <ubizjak@gmail.com>
PR target/39118
* config/i386/i386.c (expand_prologue): Emit blockage at the end
of function prologue when frame pointer is used to access
red zone area.
2009-02-10 Richard Guenther <rguenther@suse.de> 2009-02-10 Richard Guenther <rguenther@suse.de>
PR middle-end/39127 PR middle-end/39127
...@@ -100,8 +107,7 @@ ...@@ -100,8 +107,7 @@
2009-02-06 Nick Clifton <nickc@redhat.com> 2009-02-06 Nick Clifton <nickc@redhat.com>
* config/m32c/m32c.h (PCC_BITFIELD_TYPE_MATTERS): Define to * config/m32c/m32c.h (PCC_BITFIELD_TYPE_MATTERS): Define to zero.
zero.
2009-02-06 Paolo Bonzini <bonzini@gnu.org> 2009-02-06 Paolo Bonzini <bonzini@gnu.org>
...@@ -249,7 +255,7 @@ ...@@ -249,7 +255,7 @@
2009-02-02 Catherine Moore <clm@codesourcery.com> 2009-02-02 Catherine Moore <clm@codesourcery.com>
* sde.h (SUBTARGET_ARM_SPEC): Don;t assemble -fpic code as -mabicalls. * sde.h (SUBTARGET_ARM_SPEC): Don't assemble -fpic code as -mabicalls.
2009-02-02 Richard Sandiford <rdsandiford@googlemail.com> 2009-02-02 Richard Sandiford <rdsandiford@googlemail.com>
...@@ -444,8 +450,7 @@ ...@@ -444,8 +450,7 @@
* regclass.c: Rename reginfo.c. Change file description. * regclass.c: Rename reginfo.c. Change file description.
(FORBIDDEN_INC_DEC_CLASSES): Remove. (FORBIDDEN_INC_DEC_CLASSES): Remove.
(reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove.
Remove.
(init_reg_sets_1): Remove code for evaluation of (init_reg_sets_1): Remove code for evaluation of
reg_class_superclasses and losing_caller_save_reg_set. reg_class_superclasses and losing_caller_save_reg_set.
(init_regs): Remove init_reg_autoinc. (init_regs): Remove init_reg_autoinc.
...@@ -579,8 +584,7 @@ ...@@ -579,8 +584,7 @@
2009-01-28 Jakub Jelinek <jakub@redhat.com> 2009-01-28 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/38740 PR rtl-optimization/38740
* reorg.c (gate_handle_delay_slots): Avoid dbr scheduling * reorg.c (gate_handle_delay_slots): Avoid dbr scheduling if !optimize.
if !optimize.
* config/mips/mips.c (mips_reorg): Likewise. * config/mips/mips.c (mips_reorg): Likewise.
2009-01-28 Richard Guenther <rguenther@suse.de> 2009-01-28 Richard Guenther <rguenther@suse.de>
......
...@@ -7997,6 +7997,7 @@ ix86_expand_prologue (void) ...@@ -7997,6 +7997,7 @@ ix86_expand_prologue (void)
{ {
rtx insn; rtx insn;
bool pic_reg_used; bool pic_reg_used;
bool emit_blockage = false;
struct ix86_frame frame; struct ix86_frame frame;
HOST_WIDE_INT allocate; HOST_WIDE_INT allocate;
...@@ -8214,7 +8215,7 @@ ix86_expand_prologue (void) ...@@ -8214,7 +8215,7 @@ ix86_expand_prologue (void)
{ {
if (pic_reg_used) if (pic_reg_used)
emit_insn (gen_prologue_use (pic_offset_table_rtx)); emit_insn (gen_prologue_use (pic_offset_table_rtx));
emit_insn (gen_blockage ()); emit_blockage = true;
} }
if (crtl->drap_reg && !crtl->stack_realign_needed) if (crtl->drap_reg && !crtl->stack_realign_needed)
...@@ -8227,6 +8228,18 @@ ix86_expand_prologue (void) ...@@ -8227,6 +8228,18 @@ ix86_expand_prologue (void)
insn = emit_insn (gen_rtx_SET (VOIDmode, crtl->drap_reg, x)); insn = emit_insn (gen_rtx_SET (VOIDmode, crtl->drap_reg, x));
} }
/* Prevent instructions from being scheduled into register save push
sequence when access to the redzone area is done through frame pointer.
The offset betweeh the frame pointer and the stack pointer is calculated
relative to the value of the stack pointer at the end of the function
prologue, and moving instructions that access redzone area via frame
pointer inside push sequence violates this assumption. */
if (frame_pointer_needed && frame.red_zone_size)
emit_blockage = true;
if (emit_blockage)
emit_insn (gen_blockage ());
/* Emit cld instruction if stringops are used in the function. */ /* Emit cld instruction if stringops are used in the function. */
if (TARGET_CLD && ix86_current_function_needs_cld) if (TARGET_CLD && ix86_current_function_needs_cld)
emit_insn (gen_cld ()); emit_insn (gen_cld ());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment