From 1f39323fd33d37f686399ea596d98f87b784f164 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Sat, 10 Dec 2005 01:14:38 +0000 Subject: [PATCH] re PR fortran/22527 (fortran produces mismatch types in comparision with integer to logic assignment) PR fortran/22527 * f95-lang.c (gfc_truthvalue_conversion): Use a zero of the correct integer type when building an inequality. From-SVN: r108341 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/f95-lang.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0f9cd130451..58cf367f1c8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-12-09 Roger Sayle + + PR fortran/22527 + * f95-lang.c (gfc_truthvalue_conversion): Use a zero of the correct + integer type when building an inequality. + 2005-12-09 Richard Guenther * f95-lang.c (build_builtin_fntypes): Use correct diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 1ddad87e719..a5d11615646 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -257,7 +257,8 @@ gfc_truthvalue_conversion (tree expr) if (TREE_CODE (expr) == INTEGER_CST) return integer_zerop (expr) ? boolean_false_node : boolean_true_node; else - return build2 (NE_EXPR, boolean_type_node, expr, integer_zero_node); + return build2 (NE_EXPR, boolean_type_node, expr, + build_int_cst (TREE_TYPE (expr), 0)); default: internal_error ("Unexpected type in truthvalue_conversion");