diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4b053706484..130bcf866f1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2009-04-10 Paolo Bonzini + + PR middle-end/39701 + * trans.c (gfc_allocate_with_status): Fix type mismatches + on "pstat == 0". + 2009-04-10 Daniel Franke PR fortran/38709 diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 827f54eaa20..ddbc730d9d8 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -605,8 +605,8 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status) fold_build1 (INDIRECT_REF, status_type, status), build_int_cst (status_type, 0)); tmp = fold_build3 (COND_EXPR, void_type_node, - fold_build2 (NE_EXPR, boolean_type_node, - status, build_int_cst (status_type, 0)), + fold_build2 (NE_EXPR, boolean_type_node, status, + build_int_cst (TREE_TYPE (status), 0)), tmp, build_empty_stmt ()); gfc_add_expr_to_block (block, tmp); } @@ -630,7 +630,7 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status) build_int_cst (pvoid_type_node, 0)); tmp = fold_build2 (EQ_EXPR, boolean_type_node, status, - build_int_cst (status_type, 0)); + build_int_cst (TREE_TYPE (status), 0)); error = fold_build3 (COND_EXPR, void_type_node, tmp, error, gfc_finish_block (&set_status_block)); } @@ -653,7 +653,7 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status) tree tmp2; cond = fold_build2 (EQ_EXPR, boolean_type_node, status, - build_int_cst (status_type, 0)); + build_int_cst (TREE_TYPE (status), 0)); tmp2 = fold_build2 (MODIFY_EXPR, status_type, fold_build1 (INDIRECT_REF, status_type, status), build_int_cst (status_type, LIBERROR_ALLOCATION));