------- Comment #5 from ubizjak at gmail dot com  2009-02-06 15:05 -------
This patch fixes wrong scheduling:

Index: i386.md
===================================================================
--- i386.md     (revision 143890)
+++ i386.md     (working copy)
@@ -67,6 +67,7 @@
    (UNSPEC_DEF_CFA             15)
    (UNSPEC_SET_RIP             16)
    (UNSPEC_SET_GOT_OFFSET      17)
+   (UNSPEC_REDZONE_BLOCKAGE    18)

    ; TLS support
    (UNSPEC_TP                  18)
@@ -14885,6 +14886,14 @@
   ""
   [(set_attr "length" "0")])

+(define_insn "redzone_blockage"
+  [(set (match_operand 0 "" "")
+       (unspec [(match_operand 1 "" "")] UNSPEC_REDZONE_BLOCKAGE))]
+  ""
+  ""
+  [(set_attr "length" "0")])
+
+
 ;; Insn emitted into the body of a function to return from a function.
 ;; This is only done if the function's epilogue is known to be simple.
 ;; See comments for ix86_can_use_return_insn_p in i386.c.
Index: i386.c
===================================================================
--- i386.c      (revision 143890)
+++ i386.c      (working copy)
@@ -6492,6 +6492,10 @@
       emit_insn (gen_blockage ());
     }

+  if (frame_pointer_needed && frame.red_zone_size)
+    emit_insn (gen_redzone_blockage (hard_frame_pointer_rtx,
+                                    stack_pointer_rtx));
+
   /* Emit cld instruction if stringops are used in the function.  */
   if (TARGET_CLD && ix86_current_function_needs_cld)
     emit_insn (gen_cld ());


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39118

Reply via email to