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 to alias sets used in CONSTRUCTOR


This uses the same alias set when storing a field using a CONSTRUCTOR as
normal access.

Sun Sep 17 10:46:17 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* expr.c (store_constructor_field): Accept ALIAS_SET arg.
	(store_constructor): Pass alias_set to it.

*** expr.c	2000/09/17 12:45:50	1.262
--- expr.c	2000/09/17 14:28:55
*************** static int mostly_zeros_p	PARAMS ((tree)
*** 167,171 ****
  static void store_constructor_field PARAMS ((rtx, unsigned HOST_WIDE_INT,
  					     HOST_WIDE_INT, enum machine_mode,
! 					     tree, tree, unsigned int, int));
  static void store_constructor	PARAMS ((tree, rtx, unsigned int, int,
  					 HOST_WIDE_INT));
--- 167,172 ----
  static void store_constructor_field PARAMS ((rtx, unsigned HOST_WIDE_INT,
  					     HOST_WIDE_INT, enum machine_mode,
! 					     tree, tree, unsigned int, int,
! 					     int));
  static void store_constructor	PARAMS ((tree, rtx, unsigned int, int,
  					 HOST_WIDE_INT));
*************** mostly_zeros_p (exp)
*** 4176,4179 ****
--- 4177,4181 ----
     TYPE is the type of the CONSTRUCTOR, not the element type.
     ALIGN and CLEARED are as for store_constructor.
+    ALIAS_SET is the alias set to use for any stores.
  
     This provides a recursive shortcut back to store_constructor when it isn't
*************** mostly_zeros_p (exp)
*** 4184,4188 ****
  static void
  store_constructor_field (target, bitsize, bitpos,
! 			 mode, exp, type, align, cleared)
       rtx target;
       unsigned HOST_WIDE_INT bitsize;
--- 4186,4190 ----
  static void
  store_constructor_field (target, bitsize, bitpos,
! 			 mode, exp, type, align, cleared, alias_set)
       rtx target;
       unsigned HOST_WIDE_INT bitsize;
*************** store_constructor_field (target, bitsize
*** 4192,4195 ****
--- 4194,4198 ----
       unsigned int align;
       int cleared;
+      int alias_set;
  {
    if (TREE_CODE (exp) == CONSTRUCTOR
*************** store_constructor_field (target, bitsize
*** 4209,4217 ****
  			    plus_constant (XEXP (target, 0),
  					   bitpos / BITS_PER_UNIT));
        store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT);
      }
    else
      store_field (target, bitsize, bitpos, mode, exp, VOIDmode, 0, align,
! 		 int_size_in_bytes (type), 0);
  }
  
--- 4212,4222 ----
  			    plus_constant (XEXP (target, 0),
  					   bitpos / BITS_PER_UNIT));
+ 
+       MEM_ALIAS_SET (target) = alias_set;
        store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT);
      }
    else
      store_field (target, bitsize, bitpos, mode, exp, VOIDmode, 0, align,
! 		 int_size_in_bytes (type), alias_set);
  }
  
*************** store_constructor (exp, target, align, c
*** 4412,4416 ****
  #endif
  	  store_constructor_field (to_rtx, bitsize, bitpos, mode,
! 				   TREE_VALUE (elt), type, align, cleared);
  	}
      }
--- 4417,4424 ----
  #endif
  	  store_constructor_field (to_rtx, bitsize, bitpos, mode,
! 				   TREE_VALUE (elt), type, align, cleared,
! 				   DECL_NONADDRESSABLE_P (field)
! 				   ? MEM_ALIAS_SET (to_rtx)
! 				   : get_alias_set (TREE_TYPE (field)));
  	}
      }
*************** store_constructor (exp, target, align, c
*** 4548,4553 ****
  		    {
  		      bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
! 		      store_constructor_field (target, bitsize, bitpos, mode,
! 					       value, type, align, cleared);
  		    }
  		}
--- 4556,4564 ----
  		    {
  		      bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
! 		      store_constructor_field
! 			(target, bitsize, bitpos, mode, value, type, align,
! 			 cleared,
! 			 TYPE_NONALIASED_COMPONENT (type)
! 			 ? MEM_ALIAS_SET (target) : get_alias_set (elttype));
  		    }
  		}
*************** store_constructor (exp, target, align, c
*** 4637,4641 ****
  
  	      store_constructor_field (target, bitsize, bitpos, mode, value,
! 				       type, align, cleared);
  	    }
  	}
--- 4648,4656 ----
  
  	      store_constructor_field (target, bitsize, bitpos, mode, value,
! 				       type, align, cleared,
! 				       TYPE_NONALIASED_COMPONENT (type)
! 				       ? MEM_ALIAS_SET (target) :
! 				       get_alias_set (elttype));
! 
  	    }
  	}

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