This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix bug with simple returns on cc0 targets


Hi,

for a private port which both is a cc0 target and has conditional returns, 
emit_use_return_register_into_block will try to emit the use return register 
sequence between a cc0 setter and a cc0 user.

Fixed thusly, tested on x86_64-suse-linux, applied on the mainline.


2013-03-25  Eric Botcazou  <ebotcazou@adacore.com>

	* function.c (emit_use_return_register_into_block): On cc0 targets,
	do not emit the sequence between cc0 setter and user.


-- 
Eric Botcazou
Index: function.c
===================================================================
--- function.c	(revision 197003)
+++ function.c	(working copy)
@@ -5598,12 +5598,17 @@ prepare_shrink_wrap (basic_block entry_b
 static void
 emit_use_return_register_into_block (basic_block bb)
 {
-  rtx seq;
+  rtx seq, insn;
   start_sequence ();
   use_return_register ();
   seq = get_insns ();
   end_sequence ();
-  emit_insn_before (seq, BB_END (bb));
+  insn = BB_END (bb);
+#ifdef HAVE_cc0
+  if (reg_mentioned_p (cc0_rtx, PATTERN (insn)))
+    insn = prev_cc0_setter (insn);
+#endif
+  emit_insn_before (seq, insn);
 }
 
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]