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]

[PATCH] Fix for sibcall C++ failure


Hi!

This patch fixes the C++ ICE I posted today for me.
IMHO we must push the cleanup start to the tail_call insn sequence, not the
one preceeding the call (expand_end_target_temps is pushed to the tail_call
insn sequence as well, so that explains why the EH_REGION notes are not
emited in pairs).
Ok to commit if it bootstraps and passes testsuite (am just starting
bootstrap)?

2000-05-15  Jakub Jelinek  <jakub@redhat.com>

	* calls.c (expand_call): Move expand_start_target_temps call after
	start_sequence().

--- gcc/calls.c.jj	Fri May 12 09:52:43 2000
+++ gcc/calls.c	Mon May 15 10:20:50 2000
@@ -2341,12 +2341,6 @@ expand_call (exp, target, ignore)
              only one of the alternates.  */
 	  emit_queue ();
 
-	  /* We know at this point that there are not currently any
-	     pending cleanups.  If, however, in the process of evaluating
-	     the arguments we were to create some, we'll need to be
-	     able to get rid of them.  */
-	  expand_start_target_temps ();
-
 	  /* State variables we need to save and restore between
 	     iterations.  */
 	  save_pending_stack_adjust = pending_stack_adjust;
@@ -2367,6 +2361,15 @@ expand_call (exp, target, ignore)
 	 From this point on, if the sibling call fails, we want to set
 	 sibcall_failure instead of continuing the loop.  */
       start_sequence ();
+
+      if (pass == 0)
+	{
+	  /* We know at this point that there are not currently any
+	     pending cleanups.  If, however, in the process of evaluating
+	     the arguments we were to create some, we'll need to be
+	     able to get rid of them.  */
+	  expand_start_target_temps ();
+	}
 
       /* When calling a const function, we must pop the stack args right away,
 	 so that the pop is deleted or moved with the call.  */

	Jakub

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