aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-01-15 17:40:26 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-01-15 17:40:26 +0000
commit03cd8aba32349dbbf5f2ccb9bddadd2bccaefd1b (patch)
tree81f71c4ac11c1ee3a6504b15060bf6ffe8cf4a6d /gcc/builtins.c
parent4da782145bc9e183bc091995ab3cd77e2dffd551 (diff)
downloadgcc-03cd8aba32349dbbf5f2ccb9bddadd2bccaefd1b.zip
gcc-03cd8aba32349dbbf5f2ccb9bddadd2bccaefd1b.tar.gz
gcc-03cd8aba32349dbbf5f2ccb9bddadd2bccaefd1b.tar.bz2
real.c (real_sqrt): Return a bool result indicating whether a floating point exception or trap...
* real.c (real_sqrt): Return a bool result indicating whether a floating point exception or trap should be raised. * real.h (real_sqrt): Update function prototype. * builtins.c (fold_builtin): Only fold non-trapping square roots unless we're ignoring errno and trapping math. From-SVN: r61337
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 7c9d999..ffa09f9 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1,6 +1,6 @@
/* Expand builtin functions.
- Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -4308,11 +4308,9 @@ fold_builtin (exp)
x = TREE_REAL_CST (arg);
mode = TYPE_MODE (TREE_TYPE (arg));
- if (!HONOR_SNANS (mode) || !real_isnan (&x))
- {
- real_sqrt (&r, mode, &x);
+ if (real_sqrt (&r, mode, &x)
+ || (!flag_trapping_math && !flag_errno_math))
return build_real (TREE_TYPE (arg), r);
- }
}
/* Optimize sqrt(exp(x)) = exp(x/2.0). */