aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-11-09 11:01:13 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-11-09 11:01:13 -0500
commit2ae342f72c43bc0092015de765be3dd164a3ab24 (patch)
treecd007e11f866d115e3ef48cd3088257a9a935c2d
parent8aaa43506157312bf0aaacf289c2df801569d71c (diff)
downloadgcc-2ae342f72c43bc0092015de765be3dd164a3ab24.zip
gcc-2ae342f72c43bc0092015de765be3dd164a3ab24.tar.gz
gcc-2ae342f72c43bc0092015de765be3dd164a3ab24.tar.bz2
(expand_expr, case ARRAY_REF): Properly convert types of index, size,
and multiplication. From-SVN: r10573
-rw-r--r--gcc/expr.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 8fe0c43..e75a7d0 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4655,13 +4655,20 @@ expand_expr (exp, target, tmode, modifier)
matter, since expand_expr should not care.) */
TREE_SIDE_EFFECTS (array_adr) = 0;
- elt = build1 (INDIRECT_REF, type,
- fold (build (PLUS_EXPR,
- TYPE_POINTER_TO (variant_type),
- array_adr,
- fold (build (MULT_EXPR,
- TYPE_POINTER_TO (variant_type),
- index, size)))));
+ elt
+ = build1
+ (INDIRECT_REF, type,
+ fold (build (PLUS_EXPR,
+ TYPE_POINTER_TO (variant_type),
+ array_adr,
+ fold
+ (build1
+ (NOP_EXPR,
+ TYPE_POINTER_TO (variant_type),
+ fold (build (MULT_EXPR, TREE_TYPE (index),
+ index,
+ convert (TREE_TYPE (index),
+ size))))))));;
/* Volatility, etc., of new expression is same as old
expression. */