On Oct 13, 2007, at 7:20 AM, Ron Blaschke wrote:

Attached patch should fix computed goto on Solaris with the Sun C compiler.

All tests successful (7 subtests UNEXPECTEDLY SUCCEEDED), 11 tests and
621 subtests skipped.
Passed TODO     Stat Wstat TODOs Pass  List of Passed
----------------------------------------------------------------------- --------
t/src/intlist.t                4    4  1-4
t/src/io.t                     3    3  16-17 19
Files=349, Tests=7904, 1398 wallclock secs (668.38 cusr + 455.97 csys =
1124.35 CPU)

Could someone please review the patch if I got it right, and maybe test
it on other computed goto platforms?

Ron
Index: lib/Parrot/Ops2c/Utils.pm
===================================================================
--- lib/Parrot/Ops2c/Utils.pm   (revision 22065)
+++ lib/Parrot/Ops2c/Utils.pm   (working copy)
@@ -588,7 +588,7 @@
 # endif
 #endif
     _reg_base = (char*)interp->ctx.bp.regs_i;
-    goto **cur_opcode;
+    goto **(void **)cur_opcode;

 END_C
     }
Index: lib/Parrot/OpTrans/CGP.pm
===================================================================
--- lib/Parrot/OpTrans/CGP.pm   (revision 22065)
+++ lib/Parrot/OpTrans/CGP.pm   (working copy)
@@ -91,7 +91,7 @@
         return "if ($addr == 0)
           return 0;
    _reg_base = (char*)interp->ctx.bp.regs_i;
-   goto **(cur_opcode = opcode_to_prederef(interp, $addr))";
+   goto **(void **)(cur_opcode = opcode_to_prederef(interp, $addr))";
     }
 }

@@ -105,7 +105,7 @@
 sub goto_offset {
     my ( $self, $offset ) = @_;

-    return "goto **(cur_opcode += $offset)";
+    return "goto **(void **)(cur_opcode += $offset)";
 }

 =item C<goto_pop()>
Index: PLATFORMS
===================================================================
--- PLATFORMS   (revision 22065)
+++ PLATFORMS   (working copy)
@@ -30,8 +30,8 @@
sol8-sparc-cc B - - - - - - Y/412 ? 20070917 sol10-sparc-cc_5.8 B Y - - Y Y Y Y/9 ? 20060807 sol10-sparc-gcc_4.0.2 B Y - - Y Y Y Y/9 ? 20060807 -sol10-x86-cc_5.9 4 - - - - - Y Y*4 ? 20070914 -sol11-x86-cc_5.8 - - - - - - Y/121*4 ? 20070821 +sol10-x86-cc_5.9 4 - - - - - Y Y ? 20071010 +sol11-x86-cc_5.8 - - - - - - Y/121 ? 20070821 opensolaris-x86-gcc_4.0.3 4 Y Y ? ? ? Y Y/3 ? 20070417 tru64-alpha-compaq_c6.5 8 ? ? ? Y ? Y Y/2 ? 20060203 win32-x86-cygwin_1.5.21 - - - - - - - - 20070221
@@ -71,7 +71,6 @@
 *2 some tests fail intermittently when building x86 on xeon processor
 *3 t/stm/basic_mt.t occasionally hangs. kill it for tests to complete.
    1 other test fails. 7 unexpected todos succeed.
-*4 You must run Configure.pl with --cgoto=0, see RT#44291

The following configurations are also working on x86/linux (and possibly
 other platforms):


Just to clarify, you did reenable CGP in compilers/imcc/main.c, correct? It's been disabled for a while.

Reply via email to