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]

Fix ptr_mode != Pmode problems in except.c


This came up in VxWorks support for 64-bit Sparc.  I tested to make sure the
reported problem was fixed on that cross-compiler and did bootstrap and
regression testing on alphaev56.

Sat Jun  2 06:53:50 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* except.c (expand_builtin_frob_return_addr): Add missing call
	to convert_memory_address #ifdef POINTERS_EXTEND_UNSIGNED.
	(expand_builtin_eh_return): Likewise.
	(expand_eh_return): Clean up ptr_mode != Pmode cases.

*** except.c	2001/05/20 00:35:24	1.164
--- except.c	2001/06/02 10:42:35
*************** expand_builtin_frob_return_addr (addr_tr
*** 2969,2972 ****
--- 2969,2976 ----
    rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, 0);
  
+ #ifdef POINTERS_EXTEND_UNSIGNED
+   addr = convert_memory_address (Pmode, addr);
+ #endif
+ 
  #ifdef RETURN_ADDR_OFFSET
    addr = force_reg (Pmode, addr);
*************** expand_builtin_eh_return (stackadj_tree,
*** 2989,2992 ****
--- 2993,3001 ----
    handler = expand_expr (handler_tree, cfun->eh->ehr_handler, VOIDmode, 0);
  
+ #ifdef POINTERS_EXTEND_UNSIGNED
+   stackadj = convert_memory_address (Pmode, stackadj);
+   handler = convert_memory_address (Pmode, handler);
+ #endif
+ 
    if (! cfun->eh->ehr_label)
      {
*************** expand_eh_return ()
*** 3036,3041 ****
  #endif
      {
-       rtx handler;
- 
        ra = EH_RETURN_HANDLER_RTX;
        if (! ra)
--- 3045,3048 ----
*************** expand_eh_return ()
*** 3046,3060 ****
  
        emit_move_insn (sa, cfun->eh->ehr_stackadj);
! 
!       handler = cfun->eh->ehr_handler;
!       if (GET_MODE (ra) != Pmode)
! 	{
! #ifdef POINTERS_EXTEND_UNSIGNED
! 	  handler = convert_memory_address (GET_MODE (ra), handler);
! #else
! 	  handler = convert_to_mode (GET_MODE (ra), handler, 0);
! #endif
! 	}
!       emit_move_insn (ra, handler);
      }
  
--- 3053,3057 ----
  
        emit_move_insn (sa, cfun->eh->ehr_stackadj);
!       emit_move_insn (ra, cfun->eh->ehr_handler);
      }
  


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