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
This commit is contained in:
Jakub Jelinek 2005-06-26 07:21:25 +02:00 committed by Jakub Jelinek
parent 03fd9aa2c7
commit 7a1df4e2d7
2 changed files with 14 additions and 3 deletions

View File

@ -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.

View File

@ -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);