This is the mail archive of the 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 committed for scheduling bug with sjlj eh

This was discussed a few weeks ago.  Since the nonlocal goto receiver and
the exception handler are now adjacent for sjlj exceptions, the scheduler
can move the initialization of the frame pointer across uses of pseudo
registers, which is incorrect.  This is the fix I've added to the 2.95
branch a while ago.  Richard suggested requiring all ports that use the
scheduler to provide a blockage insn, but since we're in a slush right
now I'd rather not modify lots of machine descriptions.  We could revisit
this after 3.0 has branched.
(An alternative solution would be to get rid of all blockage patterns and
make an empty ASM_INPUT the "official" blockage insn).

Bootstrapped with "-O2 -fsjlj-exceptions" on i686-linux.


Index: ChangeLog
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.9198
diff -u -p -r1.9198 ChangeLog
--- ChangeLog	2001/02/06 13:12:55	1.9198
+++ ChangeLog	2001/02/06 17:08:30
@@ -1,3 +1,8 @@
+2001-02-06  Bernd Schmidt  <>
+	* builtins.c (expand_builtin_setjmp_receiver): Emit an ASM_INPUT as
+	a scheduling barrier at the end.
 Tue Feb  6 07:54:51 2001  Richard Kenner  <>

 	* print-tree.c (print_node, case PARM_DECL):
Index: builtins.c
RCS file: /cvs/gcc/egcs/gcc/builtins.c,v
retrieving revision 1.93
diff -u -p -r1.93 builtins.c
--- builtins.c	2001/02/01 12:29:18	1.93
+++ builtins.c	2001/02/06 17:08:33
@@ -581,6 +581,13 @@ expand_builtin_setjmp_receiver (receiver
       { /* Nothing */ }
+  /* @@@ This is a kludge.  Not all machine descriptions define a blockage
+     insn, but we must not allow the code we just generated to be reordered
+     by scheduling.  Specifically, the update of the frame pointer must
+     happen immediately, not later.  So emit an ASM_INPUT to act as blockage
+     insn.  */
+  emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));

 /* __builtin_setjmp is passed a pointer to an array of five words (not

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