From 235783d1f06a6107df508d57e1fd462220583afa Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 20 Oct 2000 20:57:21 +0000 Subject: expr.c (expand_expr, [...]): Set RTX_UNCHANGING_P on returned MEM. * expr.c (expand_expr, case SAVE_EXPR): Set RTX_UNCHANGING_P on returned MEM. (expand_expr_unaligned, case ARRAY_REF): Check that index is a constant before comparing it; use tree_low_cst. * tree.c (save_expr): Set TREE_READONLY. (substitute_expr): Return inside of NON_LVALUE_EXPR. (build, build1): Set TREE_READONLY if all operands are. (build_index_type): If upper bound is a negative number, lower bound is zero and sizetype is unsigned, use upper bound of one and lower of zero. From-SVN: r36979 --- gcc/expr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/expr.c') diff --git a/gcc/expr.c b/gcc/expr.c index 84e574d..cc3ec34 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6222,7 +6222,11 @@ expand_expr (exp, target, tmode, modifier) if (mode == VOIDmode) temp = const0_rtx; else - temp = assign_temp (type, 3, 0, 0); + { + temp = assign_temp (type, 3, 0, 0); + if (GET_CODE (temp) == MEM) + RTX_UNCHANGING_P (temp) = 1; + } SAVE_EXPR_RTL (exp) = temp; if (!optimize && GET_CODE (temp) == REG) @@ -8683,6 +8687,7 @@ expand_expr_unaligned (exp, palign) that was declared const. */ if (TREE_CODE (array) == CONSTRUCTOR && ! TREE_SIDE_EFFECTS (array) + && host_integerp (index, 0) && 0 > compare_tree_int (index, list_length (CONSTRUCTOR_ELTS (TREE_OPERAND (exp, 0))))) @@ -8690,7 +8695,7 @@ expand_expr_unaligned (exp, palign) tree elem; for (elem = CONSTRUCTOR_ELTS (TREE_OPERAND (exp, 0)), - i = TREE_INT_CST_LOW (index); + i = tree_low_cst (index, 0); elem != 0 && i != 0; i--, elem = TREE_CHAIN (elem)) ; -- cgit v1.1