aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-10-20 20:57:21 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-10-20 16:57:21 -0400
commit235783d1f06a6107df508d57e1fd462220583afa (patch)
tree0a6fc6a8a2eadc64eb528baac5aba3b8271e3eed /gcc/expr.c
parent948068e2ed9b6f34dc92cff5b6e846406f4b3a7e (diff)
downloadgcc-235783d1f06a6107df508d57e1fd462220583afa.zip
gcc-235783d1f06a6107df508d57e1fd462220583afa.tar.gz
gcc-235783d1f06a6107df508d57e1fd462220583afa.tar.bz2
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
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c9
1 files changed, 7 insertions, 2 deletions
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))
;