2003-06-30 James E Wilson * alias.c (find_base_value, case REG): Return 0 not src if no base found. * emit-rtl.c (set_mem_attribute_minus_bitpos): When handle ARRAY_REF, loop over new variable t2 instead of t. Index: alias.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/alias.c,v retrieving revision 1.195 diff -p -r1.195 alias.c *** alias.c 16 Jun 2003 11:42:23 -0000 1.195 --- alias.c 30 Jun 2003 08:01:56 -0000 *************** find_base_value (rtx src) *** 781,787 **** return reg_base_value[regno]; } ! return src; case MEM: /* Check for an argument passed in memory. Only record in the --- 781,787 ---- return reg_base_value[regno]; } ! return 0; case MEM: /* Check for an argument passed in memory. Only record in the Index: emit-rtl.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v retrieving revision 1.336 diff -p -r1.336 emit-rtl.c *** emit-rtl.c 27 Jun 2003 09:49:30 -0000 1.336 --- emit-rtl.c 30 Jun 2003 08:02:01 -0000 *************** set_mem_attributes_minus_bitpos (ref, t, *** 2013,2023 **** else if (TREE_CODE (t) == ARRAY_REF) { tree off_tree = size_zero_node; do { ! tree index = TREE_OPERAND (t, 1); ! tree array = TREE_OPERAND (t, 0); tree domain = TYPE_DOMAIN (TREE_TYPE (array)); tree low_bound = (domain ? TYPE_MIN_VALUE (domain) : 0); tree unit_size = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (array))); --- 2013,2026 ---- else if (TREE_CODE (t) == ARRAY_REF) { tree off_tree = size_zero_node; + /* We can't modify t, because it use it at the end of the + function. */ + tree t2 = t; do { ! tree index = TREE_OPERAND (t2, 1); ! tree array = TREE_OPERAND (t2, 0); tree domain = TYPE_DOMAIN (TREE_TYPE (array)); tree low_bound = (domain ? TYPE_MIN_VALUE (domain) : 0); tree unit_size = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (array))); *************** set_mem_attributes_minus_bitpos (ref, t, *** 2034,2040 **** WITH_RECORD_EXPR; if the component size is, pass our component to one. */ if (CONTAINS_PLACEHOLDER_P (index)) ! index = build (WITH_RECORD_EXPR, TREE_TYPE (index), index, t); if (CONTAINS_PLACEHOLDER_P (unit_size)) unit_size = build (WITH_RECORD_EXPR, sizetype, unit_size, array); --- 2037,2043 ---- WITH_RECORD_EXPR; if the component size is, pass our component to one. */ if (CONTAINS_PLACEHOLDER_P (index)) ! index = build (WITH_RECORD_EXPR, TREE_TYPE (index), index, t2); if (CONTAINS_PLACEHOLDER_P (unit_size)) unit_size = build (WITH_RECORD_EXPR, sizetype, unit_size, array); *************** set_mem_attributes_minus_bitpos (ref, t, *** 2045,2072 **** index, unit_size)), off_tree)); ! t = TREE_OPERAND (t, 0); } ! while (TREE_CODE (t) == ARRAY_REF); ! if (DECL_P (t)) { ! expr = t; offset = NULL; if (host_integerp (off_tree, 1)) { HOST_WIDE_INT ioff = tree_low_cst (off_tree, 1); HOST_WIDE_INT aoff = (ioff & -ioff) * BITS_PER_UNIT; ! align = DECL_ALIGN (t); if (aoff && (unsigned HOST_WIDE_INT) aoff < align) align = aoff; offset = GEN_INT (ioff); apply_bitpos = bitpos; } } ! else if (TREE_CODE (t) == COMPONENT_REF) { ! expr = component_ref_for_mem_expr (t); if (host_integerp (off_tree, 1)) { offset = GEN_INT (tree_low_cst (off_tree, 1)); --- 2048,2075 ---- index, unit_size)), off_tree)); ! t2 = TREE_OPERAND (t2, 0); } ! while (TREE_CODE (t2) == ARRAY_REF); ! if (DECL_P (t2)) { ! expr = t2; offset = NULL; if (host_integerp (off_tree, 1)) { HOST_WIDE_INT ioff = tree_low_cst (off_tree, 1); HOST_WIDE_INT aoff = (ioff & -ioff) * BITS_PER_UNIT; ! align = DECL_ALIGN (t2); if (aoff && (unsigned HOST_WIDE_INT) aoff < align) align = aoff; offset = GEN_INT (ioff); apply_bitpos = bitpos; } } ! else if (TREE_CODE (t2) == COMPONENT_REF) { ! expr = component_ref_for_mem_expr (t2); if (host_integerp (off_tree, 1)) { offset = GEN_INT (tree_low_cst (off_tree, 1)); *************** set_mem_attributes_minus_bitpos (ref, t, *** 2076,2085 **** the size we got from the type? */ } else if (flag_argument_noalias > 1 ! && TREE_CODE (t) == INDIRECT_REF ! && TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL) { ! expr = t; offset = NULL; } } --- 2079,2088 ---- the size we got from the type? */ } else if (flag_argument_noalias > 1 ! && TREE_CODE (t2) == INDIRECT_REF ! && TREE_CODE (TREE_OPERAND (t2, 0)) == PARM_DECL) { ! expr = t2; offset = NULL; } }