This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch committed for scheduling bug with sjlj eh
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: Patch committed for scheduling bug with sjlj eh
- From: Bernd Schmidt <bernds at cambridge dot redhat dot com>
- Date: Wed, 7 Feb 2001 10:31:40 +0000 (GMT)
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.
Bernd
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 <bernds@redhat.com>
+
+ * 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 <kenner@vlsi1.ultra.nyu.edu>
* 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
else
#endif
{ /* 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