+2000-05-06 Zack Weinberg <zack@wolery.cumb.org>
+
+ * com.c (ffecom_overlap_): Set source_offset to
+ bitsize_zero_node.
+ (ffecom_tree_canonize_ptr_): Use size_binop. Convert to
+ bitsizetype before multiplying by TYPE_SIZE.
+ (ffecom_tree_canonize_ref_) [case ARRAY_REF]: Break up offset
+ calculation. Convert to bitsizetype before multiplying by
+ TYPE_SIZE.
+
2000-04-18 Zack Weinberg <zack@wolery.cumb.org>
* lex.c: Remove references to cccp.c.
return TRUE;
source_decl = source_tree;
- source_offset = size_zero_node;
+ source_offset = bitsize_zero_node;
source_size = TYPE_SIZE (TREE_TYPE (TREE_TYPE (source_tree)));
break;
*offset, TREE_OPERAND (t, 1)));
/* Convert offset (presumably in bytes) into canonical units
(presumably bits). */
- *offset = fold (build (MULT_EXPR, TREE_TYPE (*offset),
- TYPE_SIZE (TREE_TYPE (TREE_TYPE (t))),
- *offset));
+ *offset = size_binop (MULT_EXPR,
+ convert (bitsizetype, *offset),
+ TYPE_SIZE (TREE_TYPE (TREE_TYPE (t))));
break;
}
/* Not a COMMON reference, so an unrecognized pattern. */
|| (*decl == error_mark_node))
return;
- *offset
- = size_binop (MULT_EXPR,
- TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))),
- convert (sizetype,
- fold (build (MINUS_EXPR, TREE_TYPE (element),
- element,
- TYPE_MIN_VALUE
- (TYPE_DOMAIN
- (TREE_TYPE (array)))))));;
-
- *offset = size_binop (PLUS_EXPR, convert (sizetype, init_offset),
- *offset);
+ /* Calculate ((element - base) * NBBY) + init_offset. */
+ *offset = fold (build (MINUS_EXPR, TREE_TYPE (element),
+ element,
+ TYPE_MIN_VALUE (TYPE_DOMAIN
+ (TREE_TYPE (array)))));
+
+ *offset = size_binop (MULT_EXPR,
+ convert (bitsizetype, *offset),
+ TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))));
+
+ *offset = size_binop (PLUS_EXPR, init_offset, *offset);
*size = TYPE_SIZE (TREE_TYPE (t));
return;