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 for ILP32/LP64 exception handling


When in ILP32 mode on IA64 HP-UX I get an ICE when compiling del_op.cc
from libstdc++-v3 because the argument being passed in to
__cxa_call_unexpected is a 64 bit pointer but __cxa_call_unexpected
expects a 32 bit pointer.  This patch is to make the exception pointer
register set up by except.c to be type ptr_mode instead of Pmode so that
it matches what __cxa_call_unexpected is set up to recieve when used as
the argument to that routine.

For platforms where ptr_mode == Pmode this should make no difference.
Tested on IA64 HP-UX.

Steve Ellcey
sje@cup.hp.com


2002-06-27  Steve Ellcey  <sje@cup.hp.com>
	* gcc/except.c (expand_eh_region_end_cleanup): Change exception pointer
	from Pmode to ptr_mode.
	(get_exception_pointer): Ditto.
	(connect_post_landing_pads): Ditto.
	(dw2_build_landing_pads): Ditto.


*** gcc.orig/gcc/except.c	Thu Jun 27 16:29:18 2002
--- gcc/gcc/except.c	Thu Jun 27 16:30:35 2002
*************** expand_eh_region_end_cleanup (handler)
*** 569,575 ****
  
    /* In case this cleanup involves an inline destructor with a try block in
       it, we need to save the EH return data registers around it.  */
!   data_save[0] = gen_reg_rtx (Pmode);
    emit_move_insn (data_save[0], get_exception_pointer (cfun));
    data_save[1] = gen_reg_rtx (word_mode);
    emit_move_insn (data_save[1], get_exception_filter (cfun));
--- 569,575 ----
  
    /* In case this cleanup involves an inline destructor with a try block in
       it, we need to save the EH return data registers around it.  */
!   data_save[0] = gen_reg_rtx (ptr_mode);
    emit_move_insn (data_save[0], get_exception_pointer (cfun));
    data_save[1] = gen_reg_rtx (word_mode);
    emit_move_insn (data_save[1], get_exception_filter (cfun));
*************** get_exception_pointer (fun)
*** 829,835 ****
    rtx exc_ptr = fun->eh->exc_ptr;
    if (fun == cfun && ! exc_ptr)
      {
!       exc_ptr = gen_reg_rtx (Pmode);
        fun->eh->exc_ptr = exc_ptr;
      }
    return exc_ptr;
--- 829,835 ----
    rtx exc_ptr = fun->eh->exc_ptr;
    if (fun == cfun && ! exc_ptr)
      {
!       exc_ptr = gen_reg_rtx (ptr_mode);
        fun->eh->exc_ptr = exc_ptr;
      }
    return exc_ptr;
*************** connect_post_landing_pads ()
*** 1791,1797 ****
  	emit_jump (outer->post_landing_pad);
        else
  	emit_library_call (unwind_resume_libfunc, LCT_THROW,
! 			   VOIDmode, 1, cfun->eh->exc_ptr, Pmode);
  
        seq = get_insns ();
        end_sequence ();
--- 1791,1797 ----
  	emit_jump (outer->post_landing_pad);
        else
  	emit_library_call (unwind_resume_libfunc, LCT_THROW,
! 			   VOIDmode, 1, cfun->eh->exc_ptr, ptr_mode);
  
        seq = get_insns ();
        end_sequence ();
*************** dw2_build_landing_pads ()
*** 1864,1870 ****
  	}
  
        emit_move_insn (cfun->eh->exc_ptr,
! 		      gen_rtx_REG (Pmode, EH_RETURN_DATA_REGNO (0)));
        emit_move_insn (cfun->eh->filter,
  		      gen_rtx_REG (word_mode, EH_RETURN_DATA_REGNO (1)));
  
--- 1864,1870 ----
  	}
  
        emit_move_insn (cfun->eh->exc_ptr,
! 		      gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
        emit_move_insn (cfun->eh->filter,
  		      gen_rtx_REG (word_mode, EH_RETURN_DATA_REGNO (1)));
  


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