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]

Small aliasing/name display tweaks


Some minor fixes and improvement to name display code and aliasing.

Tested on alphaev56-dec-osf4.0c.

Sat Nov  3 10:37:56 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* emit-rtl.c (set_mem_attributes): Set RTX_UNCHANGINGP_P if T is a
	constant expression.
	(set_mem_decl): New function.
	* expr.h (set_mem_decl): New declaration.
	* final.c (get_decl_from_op): Don't use ORIGINAL_REGNO if not pseudo.
	(output_asm_operand_names): Add tab.
	* reload1.c (alter_reg): Set decl of MEM from REG_DECL.

*** emit-rtl.c	2001/10/30 12:41:40	1.218
--- emit-rtl.c	2001/11/03 15:16:14
*************** set_mem_attributes (ref, t, objectp)
*** 1692,1697 ****
    MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);
    RTX_UNCHANGING_P (ref)
!     |= (lang_hooks.honor_readonly
! 	&& (TYPE_READONLY (type) || TREE_READONLY (t)));
  
    /* If we are making an object of this type, or if this is a DECL, we know
--- 1690,1696 ----
    MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);
    RTX_UNCHANGING_P (ref)
!     |= ((lang_hooks.honor_readonly
! 	 && (TYPE_READONLY (type) || TREE_READONLY (t)))
! 	|| (! TYPE_P (t) && TREE_CONSTANT (t)));
  
    /* If we are making an object of this type, or if this is a DECL, we know
*************** set_mem_align (mem, align)
*** 1784,1787 ****
--- 1783,1798 ----
  				   GET_MODE (mem));
  }
+ 
+ /* Set the decl for MEM to DECL.  */
+ 
+ void
+ set_mem_decl (mem, decl)
+      rtx mem;
+      tree decl;
+ {
+   MEM_ATTRS (mem)
+     = get_mem_attrs (MEM_ALIAS_SET (mem), decl, MEM_OFFSET (mem),
+ 		     MEM_SIZE (mem), MEM_ALIGN (mem), GET_MODE (mem));
+ }
  
  /* Return a memory reference like MEMREF, but with its mode changed to MODE
*** expr.h	2001/10/25 12:55:16	1.100
--- expr.h	2001/11/03 15:16:46
*************** extern void set_mem_alias_set PARAMS ((r
*** 616,619 ****
--- 616,622 ----
  extern void set_mem_align PARAMS ((rtx, unsigned int));
  
+ /* Set the DECL for MEM to DECL.  */
+ extern void set_mem_decl PARAMS ((rtx, tree));
+ 
  /* Return a memory reference like MEMREF, but with its mode changed
     to MODE and its address changed to ADDR.
*** final.c	2001/10/28 12:42:02	1.214
--- final.c	2001/11/03 15:16:56
*************** get_decl_from_op (op, paddressp)
*** 3305,3309 ****
    *paddressp = 0;
  
!   if (GET_CODE (op) == REG)
      return REGNO_DECL (ORIGINAL_REGNO (op));
    else if (GET_CODE (op) != MEM)
--- 3305,3309 ----
    *paddressp = 0;
  
!   if (GET_CODE (op) == REG && ORIGINAL_REGNO (op) >= FIRST_PSEUDO_REGISTER)
      return REGNO_DECL (ORIGINAL_REGNO (op));
    else if (GET_CODE (op) != MEM)
*************** output_asm_operand_names (operands, opor
*** 3354,3360 ****
        if (decl && DECL_NAME (decl))
  	{
! 	  fprintf (asm_out_file, "%s %s%s",
! 		   wrote ? "," : ASM_COMMENT_START, addressp ? "*" : "",
! 		   IDENTIFIER_POINTER (DECL_NAME (decl)));
  	  wrote = 1;
  	}
--- 3354,3360 ----
        if (decl && DECL_NAME (decl))
  	{
! 	  fprintf (asm_out_file, "%c%s %s%s",
! 		   wrote ? ',' : '\t', wrote ? "" : ASM_COMMENT_START,
! 		   addressp ? "*" : "", IDENTIFIER_POINTER (DECL_NAME (decl)));
  	  wrote = 1;
  	}
*** reload1.c	2001/10/30 00:19:58	1.308
--- reload1.c	2001/11/03 15:18:08
*************** alter_reg (i, from_reg)
*** 2044,2049 ****
        /* If we have any adjustment to make, or if the stack slot is the
  	 wrong mode, make a new stack slot.  */
!       if (adjust != 0 || GET_MODE (x) != GET_MODE (regno_reg_rtx[i]))
! 	x = adjust_address_nv (x, GET_MODE (regno_reg_rtx[i]), adjust);
  
        /* Save the stack slot for later.  */
--- 2044,2058 ----
        /* If we have any adjustment to make, or if the stack slot is the
  	 wrong mode, make a new stack slot.  */
!       x = adjust_address_nv (x, GET_MODE (regno_reg_rtx[i]), adjust);
! 
!       /* If we have a decl for the original register, set it for the
! 	 memory.  If this is a shared MEM, make a copy.  */
!       if (REGNO_DECL (i))
! 	{
! 	  if (from_reg != -1 && spill_stack_slot[from_reg] == x)
! 	    x = copy_rtx (x);
! 
! 	  set_mem_decl (x, REGNO_DECL (i));
! 	}
  
        /* Save the stack slot for later.  */


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