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]

Re: PATCH: Fix EH breakage on mainline


> On Fri, May 28, 2004 at 02:23:43AM +0200, Jan Hubicka wrote:
> > Any idea what went wrong with the EH change?
> 
> Nope, I didn't bother tracking it down.

Hi,
the problem with EH_RETURN patch has been in use NON_LOCAL_GOTO.  We now
distribute this note in split_insn so after expanding the epilogue we
end up with return insn with this mark and we get confused concluding
memory stores to be dead.

The attached patch pass libjava testing.  OK?
(to recall the original disucssion, the problem is that we have ordinary
insn followed by barrier that breaks my code trying to not depend on
existence of these beasts)
This code generation is same to at least one other target.  I am quite
consued what the rest of targets does here as i386 is the only producing
barrier after eh_return expansion.  It seems to me that eh_return ought
to barrier always and thus rest of targets should be probably turned
into similar sollution to this one, right?

I still can't reproduce any problem with the other patch.

Honza

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

Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.540
diff -c -3 -p -r1.540 i386.md
*** config/i386/i386.md	28 May 2004 01:14:02 -0000	1.540
--- config/i386/i386.md	30 May 2004 23:06:49 -0000
***************
*** 137,147 ****
  
     ; REP instruction
     (UNSPEC_REP			75)
    ])
  
  (define_constants
    [(UNSPECV_BLOCKAGE		0)
-    (UNSPECV_EH_RETURN		13)
     (UNSPECV_EMMS		31)
     (UNSPECV_LDMXCSR		37)
     (UNSPECV_STMXCSR		40)
--- 137,148 ----
  
     ; REP instruction
     (UNSPEC_REP			75)
+ 
+    (UNSPEC_EH_RETURN		76)
    ])
  
  (define_constants
    [(UNSPECV_BLOCKAGE		0)
     (UNSPECV_EMMS		31)
     (UNSPECV_LDMXCSR		37)
     (UNSPECV_STMXCSR		40)
***************
*** 13880,13885 ****
--- 13881,13887 ----
    ""
  {
    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
***************
*** 13890,13905 ****
    emit_move_insn (tmp, ra);
  
    if (Pmode == SImode)
!     emit_insn (gen_eh_return_si (sa));
    else
!     emit_insn (gen_eh_return_di (sa));
    emit_barrier ();
    DONE;
  })
  
  (define_insn_and_split "eh_return_si"
!   [(unspec_volatile [(match_operand:SI 0 "register_operand" "c")]
! 		    UNSPECV_EH_RETURN)]
    "!TARGET_64BIT"
    "#"
    "reload_completed"
--- 13892,13908 ----
    emit_move_insn (tmp, ra);
  
    if (Pmode == SImode)
!     jmp = emit_jump_insn (gen_eh_return_si (sa));
    else
!     jmp = emit_jump_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))]
    "!TARGET_64BIT"
    "#"
    "reload_completed"
***************
*** 13907,13914 ****
    "ix86_expand_epilogue (2); DONE;")
  
  (define_insn_and_split "eh_return_di"
!   [(unspec_volatile [(match_operand:DI 0 "register_operand" "c")]
! 		    UNSPECV_EH_RETURN)]
    "TARGET_64BIT"
    "#"
    "reload_completed"
--- 13910,13918 ----
    "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))]
    "TARGET_64BIT"
    "#"
    "reload_completed"


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