diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-06-26 07:21:25 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-06-26 07:21:25 +0200 |
commit | 7a1df4e2d7d4c30d2fce7557ae13e23deb910f20 (patch) | |
tree | 274dc1c86917a65489986a9ef531616d122ef086 /gcc | |
parent | 03fd9aa2c7184aa67dbbbd9f1d546f395e0c67be (diff) | |
download | gcc-7a1df4e2d7d4c30d2fce7557ae13e23deb910f20.zip gcc-7a1df4e2d7d4c30d2fce7557ae13e23deb910f20.tar.gz gcc-7a1df4e2d7d4c30d2fce7557ae13e23deb910f20.tar.bz2 |
trans-stmt.c (gfc_trans_forall_1): Prefer to use smaller logical type than boolean_type_node.
* trans-stmt.c (gfc_trans_forall_1): Prefer to use smaller logical
type than boolean_type_node.
From-SVN: r101331
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 71a4c8b..e18ab3f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2005-06-25 Jakub Jelinek <jakub@redhat.com> + + * trans-stmt.c (gfc_trans_forall_1): Prefer to use smaller logical + type than boolean_type_node. + 2005-06-25 Kelley Cook <kcook@gcc.gnu.org> * all files: Update FSF address in copyright headers. diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index ed451ee..8fda557 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -2411,11 +2411,17 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) For now we assume a mask temporary is needed. */ if (code->expr) { + /* As the mask array can be very big, prefer compact + boolean types. */ + tree smallest_boolean_type_node + = gfc_get_logical_type (gfc_logical_kinds[0].kind); + /* Allocate the mask temporary. */ bytesize = fold_build2 (MULT_EXPR, gfc_array_index_type, size, - TYPE_SIZE_UNIT (boolean_type_node)); + TYPE_SIZE_UNIT (smallest_boolean_type_node)); - mask = gfc_do_allocate (bytesize, size, &pmask, &block, boolean_type_node); + mask = gfc_do_allocate (bytesize, size, &pmask, &block, + smallest_boolean_type_node); maskindex = gfc_create_var_np (gfc_array_index_type, "mi"); /* Record them in the info structure. */ @@ -2434,7 +2440,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) gfc_add_block_to_block (&body, &se.pre); /* Store the mask. */ - se.expr = convert (boolean_type_node, se.expr); + se.expr = convert (smallest_boolean_type_node, se.expr); if (pmask) tmp = gfc_build_indirect_ref (mask); |