diff options
| -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); |
