From: Zack Weinberg Date: Sat, 6 May 2000 17:29:59 +0000 (+0000) Subject: com.c (ffecom_overlap_): Set source_offset to bitsize_zero_node. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76fa6b3b73f655f8739d6704a1769ad98abaaecf;p=platform%2Fupstream%2Fgcc.git com.c (ffecom_overlap_): Set source_offset to bitsize_zero_node. * 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. From-SVN: r33730 --- diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 854802c..5c95ba1 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,13 @@ +2000-05-06 Zack Weinberg + + * 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 * lex.c: Remove references to cccp.c. diff --git a/gcc/f/com.c b/gcc/f/com.c index 5fd2482..d1ddd62 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -1712,7 +1712,7 @@ ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size, 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; @@ -9086,9 +9086,9 @@ ffecom_tree_canonize_ptr_ (tree *decl, tree *offset, *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. */ @@ -9249,18 +9249,17 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset, || (*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;