remaining libjava/verify_local_live_at_start failures

Jan Hubicka jh@suse.cz
Mon Mar 25 06:29:00 GMT 2002


> 
> In file included from
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind-sjlj.c:278:
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind.inc: In
> function `_Unwind_RaiseException_Phase2':
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind.inc:67:
> warning: implicit declaration of function `abort'
> In file included from
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind-sjlj.c:278:
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind.inc: In
> function `_Unwind_SjLj_RaiseException':
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind.inc:132: Wrong
> amount of branch edges after unconditional jump 27
> /home/hp/cvs_areas/combined/cvs_write/gcc/unwind.inc:132:
> verify_flow_info failed
> 

Hi,
the problem of i960 is the longjmp sequence emitted.  It does not contain
any jump nor call insn confusing builtins.c to mark invalid instruction
(normal jump) as nonlocal jump confusing cfgbuild and finally crasing
in verify_flow_info.

The fix is obviously to fix i960.md to emit jump insn. It does so
but masked inside volatile instruction.  Irritantingly enought this
exposes other problem - the fact that expandeder emits invalid instruction
to compute return address.  I don't have enought knowledge of i960
to fix it right now.

Here is at least the partial fix together with sanity check in
builtins.c

Honza

Mon Mar 25 17:35:22 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i960.md (ret): Set PC.
	(nonlocal_goto): Fix expander.
	* builtins.c (epxand_builin_longjmp): Check that we've emitted
	some jump or call.

*** i960.md.old	Mon Mar 25 17:30:19 2002
--- i960.md	Mon Mar 25 17:34:21 2002
***************
*** 2365,2371 ****
  ;; stack pointer, frame pointer, previous frame pointer and the return
  ;; instruction pointer.
  (define_insn "ret"
!   [(use (reg:SI 16))
     (unspec_volatile [(const_int 0)] 3)]
    ""
    "ret"
--- 2365,2372 ----
  ;; stack pointer, frame pointer, previous frame pointer and the return
  ;; instruction pointer.
  (define_insn "ret"
!   [(set (pc) (return))
!    (use (reg:SI 16))
     (unspec_volatile [(const_int 0)] 3)]
    ""
    "ret"
***************
*** 2424,2430 ****
       because we are very careful to ret from the exact save area in
       use during the original call.  */
  
!   emit_insn (gen_ret ());
    emit_barrier ();
    DONE;
  }")
--- 2425,2431 ----
       because we are very careful to ret from the exact save area in
       use during the original call.  */
  
!   emit_jump_insn (gen_ret ());
    emit_barrier ();
    DONE;
  }")
*** builtins.c.old	Mon Mar 25 17:27:33 2002
--- builtins.c	Mon Mar 25 17:28:39 2002
*************** void
*** 639,645 ****
  expand_builtin_longjmp (buf_addr, value)
       rtx buf_addr, value;
  {
!   rtx fp, lab, stack, insn;
    enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
  
    if (setjmp_alias_set == -1)
--- 639,645 ----
  expand_builtin_longjmp (buf_addr, value)
       rtx buf_addr, value;
  {
!   rtx fp, lab, stack, insn, last;
    enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
  
    if (setjmp_alias_set == -1)
*************** expand_builtin_longjmp (buf_addr, value)
*** 662,667 ****
--- 662,668 ----
  
    current_function_calls_longjmp = 1;
  
+   last = get_last_insn ();
  #ifdef HAVE_builtin_longjmp
    if (HAVE_builtin_longjmp)
      emit_insn (gen_builtin_longjmp (buf_addr));
*************** expand_builtin_longjmp (buf_addr, value)
*** 707,712 ****
--- 708,715 ----
       internal exception handling use only.  */
    for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
      {
+       if (insn == last)
+ 	abort ();
        if (GET_CODE (insn) == JUMP_INSN)
  	{
  	  REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,



More information about the Gcc-patches mailing list