+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-09 Janis Johnson <janis187@us.ibm.com>
PR c/39035
{
rtx insn;
bool pic_reg_used;
+ bool emit_blockage = false;
struct ix86_frame frame;
HOST_WIDE_INT allocate;
{
if (pic_reg_used)
emit_insn (gen_prologue_use (pic_offset_table_rtx));
- emit_insn (gen_blockage ());
+ emit_blockage = true;
}
+ /* 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. */
if (TARGET_CLD && ix86_current_function_needs_cld)
emit_insn (gen_cld ());