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
This commit is contained in:
Roger Sayle 2005-12-10 01:14:38 +00:00 committed by Roger Sayle
parent 98bfa2fb83
commit 1f39323fd3
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-12-09 Roger Sayle <roger@eyesopen.com>
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 <rguenther@suse.de>
* f95-lang.c (build_builtin_fntypes): Use correct

View File

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