diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-05-06 17:29:59 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-05-06 17:29:59 +0000 |
commit | 76fa6b3b73f655f8739d6704a1769ad98abaaecf (patch) | |
tree | 48b84eb692491d6afc688da0f6de4f0619bc5fc4 /gcc/f | |
parent | ac670723c85b2516a260ab7c9a00f7d1489bcb11 (diff) | |
download | gcc-76fa6b3b73f655f8739d6704a1769ad98abaaecf.zip gcc-76fa6b3b73f655f8739d6704a1769ad98abaaecf.tar.gz gcc-76fa6b3b73f655f8739d6704a1769ad98abaaecf.tar.bz2 |
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
Diffstat (limited to 'gcc/f')
-rw-r--r-- | gcc/f/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/f/com.c | 31 |
2 files changed, 25 insertions, 16 deletions
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 <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. 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; |