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]

Some 32/64 bugfixes


Mon Jan  1 21:28:29 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* function.c (expand_function_end): Properly handle DECL_RESULT
	and copy when ptr_mode != Pmode.
	* expmed.c (make_tree): Convert X from Pmode to ptr_mode, if needed.

*** function.c	2000/12/30 13:10:51	1.238
--- function.c	2001/01/02 02:26:38
*************** expand_function_end (filename, line, end
*** 6826,6831 ****
        || current_function_returns_pcc_struct)
      {
!       rtx value_address =
! 	XEXP (DECL_RTL (DECL_RESULT (current_function_decl)), 0);
        tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
  #ifdef FUNCTION_OUTGOING_VALUE
--- 6826,6831 ----
        || current_function_returns_pcc_struct)
      {
!       rtx value_address
! 	= XEXP (DECL_RTL (DECL_RESULT (current_function_decl)), 0);
        tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
  #ifdef FUNCTION_OUTGOING_VALUE
*************** expand_function_end (filename, line, end
*** 6835,6840 ****
  #else
        rtx outgoing
! 	= FUNCTION_VALUE (build_pointer_type (type),
! 			  current_function_decl);
  #endif
  
--- 6835,6839 ----
  #else
        rtx outgoing
! 	= FUNCTION_VALUE (build_pointer_type (type), current_function_decl);
  #endif
  
*************** expand_function_end (filename, line, end
*** 6843,6847 ****
--- 6842,6857 ----
        REG_FUNCTION_VALUE_P (outgoing) = 1;
  
+ #ifdef POINTERS_EXTEND_UNSIGNED
+       /* The address may be ptr_mode and OUTGOING may be Pmode.  */
+       if (GET_MODE (outgoing) != GET_MODE (value_address))
+ 	value_address = convert_memory_address (GET_MODE (outgoing),
+ 						value_address);
+ #endif
+ 
        emit_move_insn (outgoing, value_address);
+ 
+       /* Show return register used to hold result (in this case the address
+ 	 of the result.  */
+       current_function_return_rtx = outgoing;
      }
  
*** expmed.c	2000/12/28 08:51:59	1.73
--- expmed.c	2001/01/02 02:26:50
*************** make_tree (type, x)
*** 4067,4070 ****
--- 4067,4078 ----
        t = make_node (RTL_EXPR);
        TREE_TYPE (t) = type;
+ 
+ #ifdef POINTERS_EXTEND_UNSIGNED
+       /* If TYPE is a POINTER_TYPE, X might be Pmode with TYPE_MODE being
+ 	 ptr_mode.  So convert.  */
+       if (POINTER_TYPE_P (type) && GET_MODE (x) != TYPE_MODE (type))
+ 	x = convert_memory_address (TYPE_MODE (type), x);
+ #endif
+ 
        RTL_EXPR_RTL (t) = x;
        /* There are no insns to be output

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