From: Jakub Jelinek Date: Sun, 26 Jun 2005 05:21:25 +0000 (+0200) Subject: trans-stmt.c (gfc_trans_forall_1): Prefer to use smaller logical type than boolean_ty... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a1df4e2d7d4c30d2fce7557ae13e23deb910f20;p=gcc.git 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 71a4c8b58ac..e18ab3fe1cd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2005-06-25 Jakub Jelinek + + * trans-stmt.c (gfc_trans_forall_1): Prefer to use smaller logical + type than boolean_type_node. + 2005-06-25 Kelley Cook * all files: Update FSF address in copyright headers. diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index ed451eeb12a..8fda557de1b 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);