aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-07-29 09:57:03 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-07-29 09:57:03 +0000
commit96d034961743d3bb13117469e1c43a404cd6facc (patch)
treec558a0163b59050648d073ef7d2227b12d40ae74 /gcc
parent64fb0d3a7878671e4df0b58ab3aa00e4e860e62e (diff)
downloadgcc-96d034961743d3bb13117469e1c43a404cd6facc.zip
gcc-96d034961743d3bb13117469e1c43a404cd6facc.tar.gz
gcc-96d034961743d3bb13117469e1c43a404cd6facc.tar.bz2
builtins.c (fold_builtin_signbit): Build the comparison with a proper type.
2011-07-29 Richard Guenther <rguenther@suse.de> * builtins.c (fold_builtin_signbit): Build the comparison with a proper type. From-SVN: r176922
Diffstat (limited to 'gcc')
-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;
}