From 8aea4f8685ac33029e707942e749aa3b9354d2ac Mon Sep 17 00:00:00 2001 From: sayle Date: Sun, 5 Feb 2006 16:59:48 +0000 Subject: * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE masks instead of LOGICAL*4. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110617 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-stmt.c | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 971a3699290..34f1cb2180f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2006-02-05 Roger Sayle + + * trans-stmt.c (gfc_evaluate_where_mask): Use LOGICAL*1 for WHERE + masks instead of LOGICAL*4. + 2006-02-05 Jakub Jelinek * resolve.c (resolve_symbol): Initialize constructor_expr to NULL. diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 5f431303275..eec00e62040 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -2639,6 +2639,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, tree inner_size, size; stmtblock_t body, body1, inner_size_body; gfc_se lse, rse; + tree mask_type; tree count; tree tmpexpr; @@ -2652,9 +2653,12 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, size = compute_overall_iter_number (nested_forall_info, inner_size, &inner_size_body, block); + /* As the mask array can be very big, prefer compact boolean types. */ + mask_type = gfc_get_logical_type (gfc_logical_kinds[0].kind); + /* Allocate temporary for where mask. */ - tmp = allocate_temp_for_forall_nest_1 (boolean_type_node, size, block, - &ptemp1); + tmp = allocate_temp_for_forall_nest_1 (mask_type, size, block, &ptemp1); + /* Record the temporary address in order to free it later. */ if (ptemp1) { @@ -2666,8 +2670,8 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, } /* Allocate temporary for !mask. */ - ntmp = allocate_temp_for_forall_nest_1 (boolean_type_node, size, block, - &ptemp2); + ntmp = allocate_temp_for_forall_nest_1 (mask_type, size, block, &ptemp2); + /* Record the temporary in order to free it later. */ if (ptemp2) { -- cgit v1.2.1