aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/builtins.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5653050..fad87a0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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
* tree-predcom.c (suitable_reference_p): Volatile references
are not suitable.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 79a6b09..0ffacf9 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -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;
}