Hi!

I got SuSE 8.1, and they finally made the leap to GCC 3.x (which produces 
incompatible C++ libraries). The result for Gforth is very disappointing. GCC 
3.2 has a new feature, "cross jumps". It introduces jumps to common parts of 
the code. Unfortunately, NEXT is considdered as "common part" and "factored 
out", replacint 6 bytes of instruction with a 5 bytes jump.

To get Gforth compiled, I had to patch GCC:

--- gcc-3.2/gcc/toplev.c~       2002-05-27 07:48:15.000000000 +0200
+++ gcc-3.2/gcc/toplev.c        2002-10-03 21:28:10.000000000 +0200
@@ -610,6 +610,10 @@
 
 int flag_syntax_only = 0;
 
+/* Nonzero means perform crossjump optimization. */
+
+static int flag_crossjump = 0;
+
 /* Nonzero means perform global cse.  */
 
 static int flag_gcse;
@@ -1023,6 +1027,8 @@
    N_("Return 'short' aggregates in registers") },
   {"delayed-branch", &flag_delayed_branch, 1,
    N_("Attempt to fill delay slots of branch instructions") },
+  {"cross-jump", &flag_crossjump, 1,
+   N_("Perform crossjump optimization") },
   {"gcse", &flag_gcse, 1,
    N_("Perform the global common subexpression elimination") },
   {"gcse-lm", &flag_gcse_lm, 1,
@@ -3286,7 +3292,7 @@
   /* Cross-jumping is O(N^3) on the number of edges, thus trying to
      perform cross-jumping on flow graphs which have a high connectivity
      will take a long time.  This is similar to the test to disable GCSE.  */
-  cleanup_crossjump = CLEANUP_CROSSJUMP;
+  cleanup_crossjump = flag_crossjump ? CLEANUP_CROSSJUMP : 0;
   if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
     {
       if (optimize && warn_disabled_optimization)
@@ -4701,6 +4707,7 @@
       flag_optimize_sibling_calls = 1;
       flag_cse_follow_jumps = 1;
       flag_cse_skip_blocks = 1;
+      flag_crossjump = 1;
       flag_gcse = 1;
       flag_expensive_optimizations = 1;
       flag_strength_reduce = 1;
--------------------------------------------------------------------------------------------

This patch adds a new flag, -fno-cross-jump. This flag disables the crossjump 
feature.

Another problem: Even with -fno-gsce, GCC 3.2 distributed some code over all 
primitives. It turned out to come from the double -> long long conversion. I 
moved that out to a function, and the problem went away.

All that's reported to the GCC maintainers, and the first response I got was 
"I don't see a sore thumb sticking out". I hope they change their mind.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to