builtins.c (fold_builtin_signbit): Build the comparison with a proper type.
authorRichard Guenther <rguenther@suse.de>
Fri, 29 Jul 2011 09:57:03 +0000 (09:57 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 29 Jul 2011 09:57:03 +0000 (09:57 +0000)
2011-07-29  Richard Guenther  <rguenther@suse.de>

* builtins.c (fold_builtin_signbit): Build the comparison
with a proper type.

From-SVN: r176922

gcc/ChangeLog
gcc/builtins.c

index 5653050796b3f8c53c8dc73e90fa966c28e55d97..fad87a05171f0dfe4508aa60bc115fd287a13e23 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-29  Richard Guenther  <rguenther@suse.de>
+
+       * builtins.c (fold_builtin_signbit): Build the comparison
+       with a proper type.
+
 2011-07-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/49893
index 79a6b09e92837042abb8076280877958301eb7d5..0ffacf9d4454d855ee56bc180b337dee1f4ebccf 100644 (file)
@@ -8645,8 +8645,9 @@ fold_builtin_signbit (location_t loc, tree arg, tree type)
 
   /* If ARG's format doesn't have signed zeros, return "arg < 0.0".  */
   if (!HONOR_SIGNED_ZEROS (TYPE_MODE (TREE_TYPE (arg))))
-    return fold_build2_loc (loc, LT_EXPR, type, arg,
-                       build_real (TREE_TYPE (arg), dconst0));
+    return fold_convert (type,
+                        fold_build2_loc (loc, LT_EXPR, boolean_type_node, arg,
+                       build_real (TREE_TYPE (arg), dconst0)));
 
   return NULL_TREE;
 }