PR fortran/22527
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Dec 2005 01:14:38 +0000 (01:14 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Dec 2005 01:14:38 +0000 (01:14 +0000)
* f95-lang.c (gfc_truthvalue_conversion): Use a zero of the correct
integer type when building an inequality.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108341 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c

index 0f9cd13..58cf367 100644 (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
index 1ddad87..a5d1161 100644 (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");