From d4ce8a6024f35a5f56ef5e86222ace3e3340d15d Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 21 Dec 2011 01:58:35 +0000 Subject: Clean an inconsistency with -ffinite-math-only. Backported from the gcc-4_3-branch, revision 118001, under the GPLv2. This issue was also fixed in Apple's gcc. PR: 157025 Reviewed by: mm Approved by: jhb (mentor) MFC: 2 weeks --- contrib/gcc/ChangeLog.gcc43 | 8 ++++++++ contrib/gcc/builtins.c | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'contrib/gcc') diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43 index fbd462e..94abc02 100644 --- a/contrib/gcc/ChangeLog.gcc43 +++ b/contrib/gcc/ChangeLog.gcc43 @@ -96,6 +96,14 @@ * doc/invoke.texi: Add entry about geode processor. +2006-10-24 Richard Guenther + + PR middle-end/28796 + * builtins.c (fold_builtin_classify): Use HONOR_INFINITIES + and HONOR_NANS instead of MODE_HAS_INFINITIES and MODE_HAS_NANS + for deciding optimizations in consistency with fold-const.c + (fold_builtin_unordered_cmp): Likewise. + 2006-10-22 H.J. Lu (r117958) * config.gcc (i[34567]86-*-*): Add tmmintrin.h to extra_headers. diff --git a/contrib/gcc/builtins.c b/contrib/gcc/builtins.c index 27f1989..2359a51 100644 --- a/contrib/gcc/builtins.c +++ b/contrib/gcc/builtins.c @@ -8720,7 +8720,7 @@ fold_builtin_classify (tree fndecl, tree arglist, int builtin_index) switch (builtin_index) { case BUILT_IN_ISINF: - if (!MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) + if (!HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); if (TREE_CODE (arg) == REAL_CST) @@ -8736,8 +8736,8 @@ fold_builtin_classify (tree fndecl, tree arglist, int builtin_index) return NULL_TREE; case BUILT_IN_FINITE: - if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg))) - && !MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg))) + && !HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); if (TREE_CODE (arg) == REAL_CST) @@ -8750,7 +8750,7 @@ fold_builtin_classify (tree fndecl, tree arglist, int builtin_index) return NULL_TREE; case BUILT_IN_ISNAN: - if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg)))) + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); if (TREE_CODE (arg) == REAL_CST) @@ -8833,13 +8833,13 @@ fold_builtin_unordered_cmp (tree fndecl, tree arglist, if (unordered_code == UNORDERED_EXPR) { - if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg0)))) + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0)))) return omit_two_operands (type, integer_zero_node, arg0, arg1); return fold_build2 (UNORDERED_EXPR, type, arg0, arg1); } - code = MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg0))) ? unordered_code - : ordered_code; + code = HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0))) ? unordered_code + : ordered_code; return fold_build1 (TRUTH_NOT_EXPR, type, fold_build2 (code, type, arg0, arg1)); } -- cgit v1.1