From 96d034961743d3bb13117469e1c43a404cd6facc Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 29 Jul 2011 09:57:03 +0000 Subject: builtins.c (fold_builtin_signbit): Build the comparison with a proper type. 2011-07-29 Richard Guenther * builtins.c (fold_builtin_signbit): Build the comparison with a proper type. From-SVN: r176922 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc') 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 + * builtins.c (fold_builtin_signbit): Build the comparison + with a proper type. + +2011-07-29 Richard Guenther + 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; } -- cgit v1.1