Commit 2ae342f7 by Richard Kenner

(expand_expr, case ARRAY_REF): Properly convert types of index, size,

and multiplication.

From-SVN: r10573
parent 8aaa4350
...@@ -4655,13 +4655,20 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4655,13 +4655,20 @@ expand_expr (exp, target, tmode, modifier)
matter, since expand_expr should not care.) */ matter, since expand_expr should not care.) */
TREE_SIDE_EFFECTS (array_adr) = 0; TREE_SIDE_EFFECTS (array_adr) = 0;
elt = build1 (INDIRECT_REF, type, elt
fold (build (PLUS_EXPR, = build1
TYPE_POINTER_TO (variant_type), (INDIRECT_REF, type,
array_adr, fold (build (PLUS_EXPR,
fold (build (MULT_EXPR, TYPE_POINTER_TO (variant_type),
TYPE_POINTER_TO (variant_type), array_adr,
index, size))))); 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 /* Volatility, etc., of new expression is same as old
expression. */ expression. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment