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]

Re: [PATCH] Fix sibcall related failure in g++.old-deja/g++.other/eh1.C


> My feeling is that this should have been handled in except.c.  Expecting to
> have other random bits of the compiler clean up after internal machinations
> of EH is clearly wrong from a design standpoint.
> 
> Unfortunately, I'm not altogether certain how last_unconditional_cleanup
> works at all.  Andrew, is this of your invention, or does it predate you?

You're right, thanks.
Here is cleaner solution (and in fact, something similar is
already done with last_unconditional_cleanup in stmt in another place).

2000-06-24  Jakub Jelinek  <jakub@redhat.com>

	* stmt.c (expand_decl_cleanup): Emit a dummy insn after
	last_unconditional_cleanup.

--- gcc/stmt.c.jj	Wed Jun 14 07:10:20 2000
+++ gcc/stmt.c	Sat Jun 24 10:09:01 2000
@@ -4064,6 +4064,13 @@ expand_decl_cleanup (decl, cleanup)
 	{
 	  thisblock->data.block.last_unconditional_cleanup
 	    = get_last_insn ();
+	  /* When we insert instructions after the last unconditional cleanup,
+	     we don't adjust last_insn.  That means that a later add_insn will
+	     clobber the instructions we've just added.  The easiest way to
+	     fix this is to just insert another instruction here, so that the
+	     instructions inserted after the last unconditional cleanup are
+	     never the last instruction.  */
+	  emit_note (NULL_PTR, NOTE_INSN_DELETED);
 	  thisblock->data.block.cleanup_ptr = &thisblock->data.block.cleanups;
 	}
     }


	Jakub

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