From 711a520c401ef55219e499a9406085ef25503dd4 Mon Sep 17 00:00:00 2001 From: vehre Date: Sat, 4 Nov 2017 14:35:45 +0000 Subject: gcc/fortran/ChangeLog: 2017-11-04 Andre Vehreschild * trans-expr.c (gfc_trans_assignment_1): Character kind conversion may create a loop variant temporary, too. * trans-intrinsic.c (conv_caf_send): Treat char arrays as arrays and not as scalars. * trans.c (get_array_span): Take the character kind into account when doing pointer arithmetic. gcc/testsuite/ChangeLog: 2017-11-04 Andre Vehreschild * gfortran.dg/coarray/send_char_array_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254407 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-expr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 1a3e3d45e4c..57b62a6b0c0 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -10084,12 +10084,16 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, NOTE: This relies on having the exact dependence of the length type parameter available to the caller; gfortran saves it in the .mod files. NOTE ALSO: The concatenation operation generates a temporary pointer, - whose allocation must go to the innermost loop. */ + whose allocation must go to the innermost loop. + NOTE ALSO (2): A character conversion may generate a temporary, too. */ if (flag_realloc_lhs && expr2->ts.type == BT_CHARACTER && expr1->ts.deferred && !(lss != gfc_ss_terminator - && expr2->expr_type == EXPR_OP - && expr2->value.op.op == INTRINSIC_CONCAT)) + && ((expr2->expr_type == EXPR_OP + && expr2->value.op.op == INTRINSIC_CONCAT) + || (expr2->expr_type == EXPR_FUNCTION + && expr2->value.function.isym != NULL + && expr2->value.function.isym->id == GFC_ISYM_CONVERSION)))) gfc_add_block_to_block (&block, &rse.pre); /* Nullify the allocatable components corresponding to those of the lhs -- cgit v1.2.1 From baf9f855777713dca68b336d374c8eae9a01804c Mon Sep 17 00:00:00 2001 From: pault Date: Mon, 6 Nov 2017 09:54:09 +0000 Subject: 2017-11-06 Paul Thomas PR fortran/69739 * trans-expr.c (gfc_map_intrinsic_function): Return false for bounds without the DIM argument instead of ICEing. 2017-11-06 Paul Thomas PR fortran/69739 * gfortran.dg/pr69739.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254441 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 57b62a6b0c0..e4d45ac8d1d 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -4178,9 +4178,7 @@ gfc_map_intrinsic_function (gfc_expr *expr, gfc_interface_mapping *mapping) if (arg2 && arg2->expr_type == EXPR_CONSTANT) d = mpz_get_si (arg2->value.integer) - 1; else - /* TODO: If the need arises, this could produce an array of - ubound/lbounds. */ - gcc_unreachable (); + return false; if (expr->value.function.isym->id == GFC_ISYM_LBOUND) { -- cgit v1.2.1 From 4c796f543f500c25dcfa731d4f1a4f27b5bf050c Mon Sep 17 00:00:00 2001 From: jb Date: Wed, 8 Nov 2017 11:51:00 +0000 Subject: PR 82869 Introduce logical_type_node and use it Earlier GFortran used to redefine boolean_type_node, which in the rest of the compiler means the C/C++ _Bool/bool type, to the Fortran default logical type. When this redefinition was removed, a few issues surfaced. Namely, 1) PR 82869, where we created a boolean tmp variable, and passed it to the runtime library as a Fortran logical variable of a different size. 2) Fortran specifies that logical operations should be done with the default logical kind, not in any other kind. 3) Using 8-bit variables have some issues, such as - on x86, partial register stalls and length prefix changes. - s390 has a compare with immediate and jump instruction which works with 32-bit but not 8-bit quantities. This patch addresses these issues by introducing a type logical_type_node which is a Fortran LOGICAL variable of default kind. It is then used in places were the Fortran standard mandates, as well as for compiler generated temporary variables. For x86-64, using the Polyhedron benchmark suite, no performance or code size difference worth mentioning was observed. Regtested on x86_64-pc-linux-gnu. gcc/fortran/ChangeLog: 2017-11-08 Janne Blomqvist PR 82869 * convert.c (truthvalue_conversion): Use logical_type_node. * trans-array.c (gfc_trans_allocate_array_storage): Likewise. (gfc_trans_create_temp_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (trans_array_constructor): Likewise. (trans_array_bound_check): Likewise. (gfc_conv_array_ref): Likewise. (gfc_trans_scalarized_loop_end): Likewise. (gfc_conv_array_extent_dim): Likewise. (gfc_array_init_size): Likewise. (gfc_array_allocate): Likewise. (gfc_trans_array_bounds): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (duplicate_allocatable): Likewise. (duplicate_allocatable_coarray): Likewise. (structure_alloc_comps): Likewise (get_std_lbound): Likewise (gfc_alloc_allocatable_for_assignment): Likewise * trans-decl.c (add_argument_checking): Likewise (gfc_generate_function_code): Likewise * trans-expr.c (gfc_copy_class_to_class): Likewise (gfc_trans_class_array_init_assign): Likewise (gfc_trans_class_init_assign): Likewise (gfc_conv_expr_present): Likewise (gfc_conv_substring): Likewise (gfc_conv_cst_int_power): Likewise (gfc_conv_expr_op): Likewise (gfc_conv_procedure_call): Likewise (fill_with_spaces): Likewise (gfc_trans_string_copy): Likewise (gfc_trans_alloc_subarray_assign): Likewise (gfc_trans_pointer_assignment): Likewise (gfc_trans_scalar_assign): Likewise (fcncall_realloc_result): Likewise (alloc_scalar_allocatable_for_assignment): Likewise (trans_class_assignment): Likewise (gfc_trans_assignment_1): Likewise * trans-intrinsic.c (build_fixbound_expr): Likewise (gfc_conv_intrinsic_aint): Likewise (gfc_trans_same_strlen_check): Likewise (conv_caf_send): Likewise (trans_this_image): Likewise (conv_intrinsic_image_status): Likewise (trans_image_index): Likewise (gfc_conv_intrinsic_bound): Likewise (conv_intrinsic_cobound): Likewise (gfc_conv_intrinsic_mod): Likewise (gfc_conv_intrinsic_dshift): Likewise (gfc_conv_intrinsic_dim): Likewise (gfc_conv_intrinsic_sign): Likewise (gfc_conv_intrinsic_ctime): Likewise (gfc_conv_intrinsic_fdate): Likewise (gfc_conv_intrinsic_ttynam): Likewise (gfc_conv_intrinsic_minmax): Likewise (gfc_conv_intrinsic_minmax_char): Likewise (gfc_conv_intrinsic_anyall): Likewise (gfc_conv_intrinsic_arith): Likewise (gfc_conv_intrinsic_minmaxloc): Likewise (gfc_conv_intrinsic_minmaxval): Likewise (gfc_conv_intrinsic_btest): Likewise (gfc_conv_intrinsic_bitcomp): Likewise (gfc_conv_intrinsic_shift): Likewise (gfc_conv_intrinsic_ishft): Likewise (gfc_conv_intrinsic_ishftc): Likewise (gfc_conv_intrinsic_leadz): Likewise (gfc_conv_intrinsic_trailz): Likewise (gfc_conv_intrinsic_mask): Likewise (gfc_conv_intrinsic_spacing): Likewise (gfc_conv_intrinsic_rrspacing): Likewise (gfc_conv_intrinsic_size): Likewise (gfc_conv_intrinsic_sizeof): Likewise (gfc_conv_intrinsic_transfer): Likewise (gfc_conv_allocated): Likewise (gfc_conv_associated): Likewise (gfc_conv_same_type_as): Likewise (gfc_conv_intrinsic_trim): Likewise (gfc_conv_intrinsic_repeat): Likewise (conv_isocbinding_function): Likewise (conv_intrinsic_ieee_is_normal): Likewise (conv_intrinsic_ieee_is_negative): Likewise (conv_intrinsic_ieee_copy_sign): Likewise (conv_intrinsic_move_alloc): Likewise * trans-io.c (set_parameter_value_chk): Likewise (set_parameter_value_inquire): Likewise (set_string): Likewise * trans-openmp.c (gfc_walk_alloc_comps): Likewise (gfc_omp_clause_default_ctor): Likewise (gfc_omp_clause_copy_ctor): Likewise (gfc_omp_clause_assign_op): Likewise (gfc_omp_clause_dtor): Likewise (gfc_omp_finish_clause): Likewise (gfc_trans_omp_clauses): Likewise (gfc_trans_omp_do): Likewise * trans-stmt.c (gfc_trans_goto): Likewise (gfc_trans_sync): Likewise (gfc_trans_arithmetic_if): Likewise (gfc_trans_simple_do): Likewise (gfc_trans_do): Likewise (gfc_trans_forall_loop): Likewise (gfc_trans_where_2): Likewise (gfc_trans_allocate): Likewise (gfc_trans_deallocate): Likewise * trans-types.c (gfc_init_types): Initialize logical_type_node and its true/false trees. (gfc_get_array_descr_info): Use logical_type_node. * trans-types.h (logical_type_node): New tree. (logical_true_node): Likewise. (logical_false_node): Likewise. * trans.c (gfc_trans_runtime_check): Use logical_type_node. (gfc_call_malloc): Likewise (gfc_allocate_using_malloc): Likewise (gfc_allocate_allocatable): Likewise (gfc_add_comp_finalizer_call): Likewise (gfc_add_finalizer_call): Likewise (gfc_deallocate_with_status): Likewise (gfc_deallocate_scalar_with_status): Likewise (gfc_call_realloc): Likewise gcc/testsuite/ChangeLog: 2017-11-08 Janne Blomqvist PR 82869 * gfortran.dg/logical_temp_io.f90: New test. * gfortran.dg/logical_temp_io_kind8.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254526 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-expr.c | 82 ++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index e4d45ac8d1d..c5e1d72bd04 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1287,7 +1287,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited) from_len = gfc_conv_descriptor_size (from_data, 1); tmp = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, from_len, orig_nelems); + logical_type_node, from_len, orig_nelems); msg = xasprintf ("Array bound mismatch for dimension %d " "of array '%s' (%%ld/%%ld)", 1, name); @@ -1338,7 +1338,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited) extcopy = gfc_finish_block (&ifbody); tmp = fold_build2_loc (input_location, GT_EXPR, - boolean_type_node, from_len, + logical_type_node, from_len, integer_zero_node); tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, tmp, extcopy, stdcopy); @@ -1366,7 +1366,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited) vec_safe_push (args, to_len); extcopy = build_call_vec (fcn_type, fcn, args); tmp = fold_build2_loc (input_location, GT_EXPR, - boolean_type_node, from_len, + logical_type_node, from_len, integer_zero_node); tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, tmp, extcopy, stdcopy); @@ -1380,7 +1380,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited) { tree cond; cond = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, + logical_type_node, from_data, null_pointer_node); tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, cond, @@ -1425,7 +1425,7 @@ gfc_trans_class_array_init_assign (gfc_expr *rhs, gfc_expr *lhs, gfc_expr *obj) gfc_init_se (&src, NULL); gfc_conv_expr (&src, rhs); src.expr = gfc_build_addr_expr (NULL_TREE, src.expr); - tree cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, + tree cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node, src.expr, fold_convert (TREE_TYPE (src.expr), null_pointer_node)); res = build3_loc (input_location, COND_EXPR, TREE_TYPE (res), cond, res, @@ -1492,7 +1492,7 @@ gfc_trans_class_init_assign (gfc_code *code) { /* Check if _def_init is non-NULL. */ tree cond = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, src.expr, + logical_type_node, src.expr, fold_convert (TREE_TYPE (src.expr), null_pointer_node)); tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp), cond, @@ -1662,7 +1662,7 @@ gfc_conv_expr_present (gfc_symbol * sym) decl = GFC_DECL_SAVED_DESCRIPTOR (decl); } - cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, decl, + cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node, decl, fold_convert (TREE_TYPE (decl), null_pointer_node)); /* Fortran 2008 allows to pass null pointers and non-associated pointers @@ -1699,10 +1699,10 @@ gfc_conv_expr_present (gfc_symbol * sym) if (tmp != NULL_TREE) { - tmp = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, tmp, + tmp = fold_build2_loc (input_location, NE_EXPR, logical_type_node, tmp, fold_convert (TREE_TYPE (tmp), null_pointer_node)); cond = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR, - boolean_type_node, cond, tmp); + logical_type_node, cond, tmp); } } @@ -2264,15 +2264,15 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) { tree nonempty = fold_build2_loc (input_location, LE_EXPR, - boolean_type_node, start.expr, + logical_type_node, start.expr, end.expr); /* Check lower bound. */ - fault = fold_build2_loc (input_location, LT_EXPR, boolean_type_node, + fault = fold_build2_loc (input_location, LT_EXPR, logical_type_node, start.expr, build_int_cst (gfc_charlen_type_node, 1)); fault = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR, - boolean_type_node, nonempty, fault); + logical_type_node, nonempty, fault); if (name) msg = xasprintf ("Substring out of bounds: lower bound (%%ld) of '%s' " "is less than one", name); @@ -2285,10 +2285,10 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, free (msg); /* Check upper bound. */ - fault = fold_build2_loc (input_location, GT_EXPR, boolean_type_node, + fault = fold_build2_loc (input_location, GT_EXPR, logical_type_node, end.expr, se->string_length); fault = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR, - boolean_type_node, nonempty, fault); + logical_type_node, nonempty, fault); if (name) msg = xasprintf ("Substring out of bounds: upper bound (%%ld) of '%s' " "exceeds string length (%%ld)", name); @@ -2890,9 +2890,9 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs) /* If rhs < 0 and lhs is an integer, the result is -1, 0 or 1. */ if ((sgn == -1) && (TREE_CODE (type) == INTEGER_TYPE)) { - tmp = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, + tmp = fold_build2_loc (input_location, EQ_EXPR, logical_type_node, lhs, build_int_cst (TREE_TYPE (lhs), -1)); - cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, + cond = fold_build2_loc (input_location, EQ_EXPR, logical_type_node, lhs, build_int_cst (TREE_TYPE (lhs), 1)); /* If rhs is even, @@ -2900,7 +2900,7 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs) if ((n & 1) == 0) { tmp = fold_build2_loc (input_location, TRUTH_OR_EXPR, - boolean_type_node, tmp, cond); + logical_type_node, tmp, cond); se->expr = fold_build3_loc (input_location, COND_EXPR, type, tmp, build_int_cst (type, 1), build_int_cst (type, 0)); @@ -3386,8 +3386,8 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr) if (lop) { - /* The result of logical ops is always boolean_type_node. */ - tmp = fold_build2_loc (input_location, code, boolean_type_node, + /* The result of logical ops is always logical_type_node. */ + tmp = fold_build2_loc (input_location, code, logical_type_node, lse.expr, rse.expr); se->expr = convert (type, tmp); } @@ -4985,7 +4985,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tree descriptor_data; descriptor_data = ss->info->data.array.data; - tmp = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, + tmp = fold_build2_loc (input_location, EQ_EXPR, logical_type_node, descriptor_data, fold_convert (TREE_TYPE (descriptor_data), null_pointer_node)); @@ -5149,7 +5149,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tree cond; tmp = gfc_build_addr_expr (NULL_TREE, parmse.expr); cond = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, tmp, + logical_type_node, tmp, fold_convert (TREE_TYPE (tmp), null_pointer_node)); gfc_start_block (&block); @@ -5681,16 +5681,16 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, present = gfc_conv_expr_present (e->symtree->n.sym); type = TREE_TYPE (present); present = fold_build2_loc (input_location, EQ_EXPR, - boolean_type_node, present, + logical_type_node, present, fold_convert (type, null_pointer_node)); type = TREE_TYPE (parmse.expr); null_ptr = fold_build2_loc (input_location, EQ_EXPR, - boolean_type_node, parmse.expr, + logical_type_node, parmse.expr, fold_convert (type, null_pointer_node)); cond = fold_build2_loc (input_location, TRUTH_ORIF_EXPR, - boolean_type_node, present, null_ptr); + logical_type_node, present, null_ptr); } else { @@ -5717,7 +5717,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tmp = gfc_build_addr_expr (NULL_TREE, tmp); cond = fold_build2_loc (input_location, EQ_EXPR, - boolean_type_node, tmp, + logical_type_node, tmp, fold_convert (TREE_TYPE (tmp), null_pointer_node)); } @@ -6213,7 +6213,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, happen in a function returning a pointer. */ tmp = gfc_conv_descriptor_data_get (info->descriptor); tmp = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, + logical_type_node, tmp, info->data); gfc_trans_runtime_check (true, false, tmp, &se->pre, NULL, gfc_msg_fault); @@ -6339,7 +6339,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, final_fndecl = gfc_class_vtab_final_get (se->expr); is_final = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, + logical_type_node, final_fndecl, fold_convert (TREE_TYPE (final_fndecl), null_pointer_node)); @@ -6413,7 +6413,7 @@ fill_with_spaces (tree start, tree type, tree size) gfc_init_block (&loop); /* Exit condition. */ - cond = fold_build2_loc (input_location, LE_EXPR, boolean_type_node, i, + cond = fold_build2_loc (input_location, LE_EXPR, logical_type_node, i, build_zero_cst (sizetype)); tmp = build1_v (GOTO_EXPR, exit_label); tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, cond, tmp, @@ -6506,7 +6506,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest, */ /* Do nothing if the destination length is zero. */ - cond = fold_build2_loc (input_location, GT_EXPR, boolean_type_node, dlen, + cond = fold_build2_loc (input_location, GT_EXPR, logical_type_node, dlen, build_int_cst (size_type_node, 0)); /* For non-default character kinds, we have to multiply the string @@ -6542,7 +6542,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest, gfc_add_expr_to_block (&tmpblock2, tmp2); /* If the destination is longer, fill the end with spaces. */ - cond2 = fold_build2_loc (input_location, LT_EXPR, boolean_type_node, slen, + cond2 = fold_build2_loc (input_location, LT_EXPR, logical_type_node, slen, dlen); /* Wstringop-overflow appears at -O3 even though this warning is not @@ -7127,7 +7127,7 @@ gfc_trans_alloc_subarray_assign (tree dest, gfc_component * cm, null_pointer_node); null_expr = gfc_finish_block (&block); tmp = gfc_conv_descriptor_data_get (arg->symtree->n.sym->backend_decl); - tmp = build2_loc (input_location, EQ_EXPR, boolean_type_node, tmp, + tmp = build2_loc (input_location, EQ_EXPR, logical_type_node, tmp, fold_convert (TREE_TYPE (tmp), null_pointer_node)); return build3_v (COND_EXPR, tmp, null_expr, non_null_expr); @@ -8684,7 +8684,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2) lsize = gfc_evaluate_now (lsize, &block); rsize = gfc_evaluate_now (rsize, &block); - fault = fold_build2_loc (input_location, LT_EXPR, boolean_type_node, + fault = fold_build2_loc (input_location, LT_EXPR, logical_type_node, rsize, lsize); msg = _("Target of rank remapping is too small (%ld < %ld)"); @@ -8803,7 +8803,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts, /* Are the rhs and the lhs the same? */ if (deep_copy) { - cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, + cond = fold_build2_loc (input_location, EQ_EXPR, logical_type_node, gfc_build_addr_expr (NULL_TREE, lse->expr), gfc_build_addr_expr (NULL_TREE, rse->expr)); cond = gfc_evaluate_now (cond, &lse->pre); @@ -9078,7 +9078,7 @@ fcncall_realloc_result (gfc_se *se, int rank) the lhs descriptor. */ tmp = gfc_conv_descriptor_data_get (desc); zero_cond = fold_build2_loc (input_location, EQ_EXPR, - boolean_type_node, tmp, + logical_type_node, tmp, build_int_cst (TREE_TYPE (tmp), 0)); zero_cond = gfc_evaluate_now (zero_cond, &se->post); tmp = gfc_call_free (tmp); @@ -9102,11 +9102,11 @@ fcncall_realloc_result (gfc_se *se, int rank) tmp = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type, tmp, tmp1); tmp = fold_build2_loc (input_location, NE_EXPR, - boolean_type_node, tmp, + logical_type_node, tmp, gfc_index_zero_node); tmp = gfc_evaluate_now (tmp, &se->post); zero_cond = fold_build2_loc (input_location, TRUTH_OR_EXPR, - boolean_type_node, tmp, + logical_type_node, tmp, zero_cond); } @@ -9545,7 +9545,7 @@ alloc_scalar_allocatable_for_assignment (stmtblock_t *block, /* Do the allocation if the lhs is NULL. Otherwise go to label 1. */ tmp = build_int_cst (TREE_TYPE (lse.expr), 0); - cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, + cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node, lse.expr, tmp); tmp = build3_v (COND_EXPR, cond, build1_v (GOTO_EXPR, jump_label1), @@ -9623,7 +9623,7 @@ alloc_scalar_allocatable_for_assignment (stmtblock_t *block, rhs are different. */ if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred) { - cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, + cond = fold_build2_loc (input_location, EQ_EXPR, logical_type_node, lse.string_length, size); /* Jump past the realloc if the lengths are the same. */ tmp = build3_v (COND_EXPR, cond, @@ -9769,7 +9769,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs, gfc_init_block (&alloc); gfc_allocate_using_malloc (&alloc, class_han, tmp, NULL_TREE); tmp = fold_build2_loc (input_location, EQ_EXPR, - boolean_type_node, class_han, + logical_type_node, class_han, build_int_cst (prvoid_type_node, 0)); tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, gfc_unlikely (tmp, @@ -9822,7 +9822,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs, extcopy = build_call_vec (TREE_TYPE (TREE_TYPE (fcn)), fcn, args); tmp = fold_build2_loc (input_location, GT_EXPR, - boolean_type_node, from_len, + logical_type_node, from_len, integer_zero_node); return fold_build3_loc (input_location, COND_EXPR, void_type_node, tmp, @@ -10051,7 +10051,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, if (TREE_CODE (lse.expr) == ARRAY_REF) tmp = gfc_build_addr_expr (NULL_TREE, tmp); - cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, + cond = fold_build2_loc (input_location, EQ_EXPR, logical_type_node, tmp, build_int_cst (TREE_TYPE (tmp), 0)); msg = _("Assignment of scalar to unallocated array"); gfc_trans_runtime_check (true, false, cond, &loop.pre, -- cgit v1.2.1