This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH fix bootstrap on solaris (part one)
Andreas Tobler wrote:
Richard Henderson wrote:
On Tue, Apr 13, 2004 at 10:04:59PM +0200, Andreas Tobler wrote:
And then around the gen_ret call an if(HAVE_return)?
Yes.
Ok, I have this one in the test chain, solaris & linuxppc.
I added a comment that I (we) don't accidentally remove it again :)
Huh, forgot an include. This one builds on linuxppc (which has
direct_return) and on solaris.
Andreas
Index: gcc/bb-reorder.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bb-reorder.c,v
retrieving revision 1.69
diff -u -r1.69 bb-reorder.c
--- gcc/bb-reorder.c 13 Apr 2004 23:30:24 -0000 1.69
+++ gcc/bb-reorder.c 14 Apr 2004 06:08:41 -0000
@@ -78,6 +78,7 @@
#include "fibheap.h"
#include "target.h"
#include "function.h"
+#include "tm_p.h"
#include "obstack.h"
#include "expr.h"
#include "regs.h"
@@ -87,6 +88,15 @@
the .o file there will be an extra round.*/
#define N_ROUNDS 5
+/* Stubs in case we don't have a return insn.
+ We have to check at runtime too, not only compiletime. */
+
+#ifndef HAVE_return
+#define HAVE_return 0
+#define gen_return() NULL_RTX
+#endif
+
+
/* Branch thresholds in thousandths (per mille) of the REG_BR_PROB_BASE. */
static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0};
@@ -1684,11 +1694,10 @@
(old_label),
BB_END (new_bb));
}
-#ifdef HAVE_return
- else if (GET_CODE (old_label) == RETURN)
+ else if (HAVE_return &&
+ GET_CODE (old_label) == RETURN)
new_jump = emit_jump_insn_after (gen_return (),
BB_END (new_bb));
-#endif
else
abort ();