This is the mail archive of the gcc-patches@gcc.gnu.org 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]
Other format: [Raw text]

PATCH: Fix EH breakage on mainline


Java is currently completely broken on mainline (i686). The libgcj runtime is crashing during startup due to EH problems. It appears to be due to the following patches:

2004-05-27 Jan Hubicka <jh@suse.cz>

   * i386.md (UNSPECV_EH_RETURN): Kill.
   (eh_return): Use jump_insn.
   (eh_return_si, eh_return_di): Change pattern to jump instruction.

2004-05-26 Jan Hubicka <jh@suse.cz>

* except.c (can_throw_internal): Notice RESX instructions.

Honza: please remember to test all such patches (make check) with a Java-enabled tree.

This patch reverts those patches and returns Java to a working state. After reverting, there is still a new Java testsuite failure which is probably also related:

FAIL: PR4766 -O3 compilation from source

Program received signal SIGSEGV, Segmentation fault.
unchecked_make_edge (src=0xbf225740, dst=0x0, flags=-1088388416) at ../../gcc/cfg.c:284
284 e->pred_next = dst->pred;
(gdb) bt
#0 unchecked_make_edge (src=0xbf225740, dst=0x0, flags=-1088388416)
at ../../gcc/cfg.c:284
#1 0x0817aa20 in cached_make_edge (edge_cache=0x0, src=0xbf225740, dst=0x0, flags=10)
at ../../gcc/cfg.c:332
#2 0x0817aa97 in make_edge (src=0xbf2082ec, dest=0xbf2082ec, flags=-1088388372)
at ../../gcc/cfg.c:346
#3 0x080ee30d in make_eh_edge (region=0xbf2082ec, data=0xbf22d084)
at ../../gcc/tree-eh.c:1644
#4 0x081ce7cf in add_reachable_handler (info=0xbff13ea0, lp_region=Variable "lp_region"
is not available.
)
at ../../gcc/except.c:2827
#5 0x081ce80c in reachable_next_level (region=0xbf2225c0, type_thrown=0x0,
info=0xbff13ea0) at ../../gcc/except.c:2964
#6 0x081ceabb in foreach_reachable_handler (region_number=2, is_resx=false,
callback=0xbf2082ec, callback_data=0xbf2082ec) at ../../gcc/except.c:3028
#7 0x080ee37c in make_eh_edges (stmt=0xbf22d084) at ../../gcc/tree-eh.c:1666
#8 0x080e7f49 in make_edges () at ../../gcc/tree-cfg.c:559
#9 0x080e96e4 in execute_build_cfg () at ../../gcc/tree-cfg.c:173
#10 0x080f4de9 in execute_pass_list (pass=0x84ff280) at ../../gcc/tree-optimize.c:406
#11 0x080f4e50 in execute_pass_list (pass=0x84ff480) at ../../gcc/tree-optimize.c:436
#12 0x080f5157 in tree_rest_of_compilation (fndecl=0xbf2ad000, nested_p=false)
at ../../gcc/tree-optimize.c:530
#13 0x080a64c7 in java_expand_body (fndecl=0xbf2082ec) at ../../gcc/java/decl.c:1846
#14 0x083f7d3d in cgraph_expand_function (node=0xbf22e5e4) at ../../gcc/cgraphunit.c:794
#15 0x083f8b3f in cgraph_optimize () at ../../gcc/cgraphunit.c:1668
#16 0x080c492b in java_parse_file (set_yydebug=0) at ../../gcc/java/jcf-parse.c:1123
#17 0x083a44ab in toplev_main (argc=3206578924, argv=0xbff143a4)
at ../../gcc/toplev.c:165


Regards

Bryce


2004-05-27  Bryce McKinlay  <mckinlay@redhat.com>

	* except.c: Revert change of 2004-05-26.
	* config/i386/i386.md: Revert change of 2004-05-27.

Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.269
retrieving revision 1.268
diff -u -r1.269 -r1.268
--- except.c	26 May 2004 09:03:23 -0000	1.269
+++ except.c	13 May 2004 06:39:38 -0000	1.268
@@ -3145,11 +3145,6 @@
       return false;
     }
 
-  if (GET_CODE (insn) == JUMP_INSN
-      && GET_CODE (PATTERN (insn)) == RESX
-      && XINT (PATTERN (insn), 0) > 0)
-    return can_throw_internal_1 (XINT (PATTERN (insn), 0));
-
   /* Every insn that might throw has an EH_REGION note.  */
   note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
   if (!note || INTVAL (XEXP (note, 0)) <= 0)
Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.539
retrieving revision 1.538
diff -u -r1.539 -r1.538
--- config/i386/i386.md	26 May 2004 22:19:40 -0000	1.539
+++ config/i386/i386.md	17 May 2004 14:30:18 -0000	1.538
@@ -137,12 +137,11 @@
 
    ; REP instruction
    (UNSPEC_REP			75)
-
-   (UNSPEC_EH_RETURN		76)
   ])
 
 (define_constants
   [(UNSPECV_BLOCKAGE		0)
+   (UNSPECV_EH_RETURN		13)
    (UNSPECV_EMMS		31)
    (UNSPECV_LDMXCSR		37)
    (UNSPECV_STMXCSR		40)
@@ -13881,7 +13880,6 @@
   ""
 {
   rtx tmp, sa = EH_RETURN_STACKADJ_RTX, ra = operands[0];
-  rtx jmp;
 
   /* Tricky bit: we write the address of the handler to which we will
      be returning into someone else's stack frame, one word below the
@@ -13892,19 +13890,16 @@
   emit_move_insn (tmp, ra);
 
   if (Pmode == SImode)
-    jmp = emit_jump_insn (gen_eh_return_si (sa));
+    emit_insn (gen_eh_return_si (sa));
   else
-    jmp = emit_jump_insn (gen_eh_return_di (sa));
-  REG_NOTES (jmp) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,
-                                     REG_NOTES (jmp));
+    emit_insn (gen_eh_return_di (sa));
   emit_barrier ();
   DONE;
 })
 
 (define_insn_and_split "eh_return_si"
-  [(set (pc) 
-        (unspec [(match_operand:SI 0 "register_operand" "c")]
-	         UNSPEC_EH_RETURN))]
+  [(unspec_volatile [(match_operand:SI 0 "register_operand" "c")]
+		    UNSPECV_EH_RETURN)]
   "!TARGET_64BIT"
   "#"
   "reload_completed"
@@ -13912,9 +13907,8 @@
   "ix86_expand_epilogue (2); DONE;")
 
 (define_insn_and_split "eh_return_di"
-  [(set (pc) 
-        (unspec [(match_operand:DI 0 "register_operand" "c")]
-	         UNSPEC_EH_RETURN))]
+  [(unspec_volatile [(match_operand:DI 0 "register_operand" "c")]
+		    UNSPECV_EH_RETURN)]
   "TARGET_64BIT"
   "#"
   "reload_completed"

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