aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-06-29 23:16:13 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-06-29 21:16:13 +0000
commit64e97443585c1a9c6bb7dd963122f848cf781639 (patch)
tree095854ed9337b2a1aeb49405293e67dad5685e37 /gcc/builtins.c
parent51a7f2053aff54ea60592d8105860b7c30867a38 (diff)
downloadgcc-64e97443585c1a9c6bb7dd963122f848cf781639.zip
gcc-64e97443585c1a9c6bb7dd963122f848cf781639.tar.gz
gcc-64e97443585c1a9c6bb7dd963122f848cf781639.tar.bz2
builtins.c (expand_builtin_mathfn, [...]): Avoid busy work when builtin is not supported by the backend.
* builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid busy work when builtin is not supported by the backend. From-SVN: r68681
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 2693810..e8ab4d574 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1789,6 +1789,10 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
/* Make a suitable register to place result in. */
mode = TYPE_MODE (TREE_TYPE (exp));
+
+ /* Before working hard, check whether the instruction is available. */
+ if (builtin_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
+ return 0;
target = gen_reg_rtx (mode);
if (! flag_errno_math || ! HONOR_NANS (mode))
@@ -1874,6 +1878,11 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
/* Make a suitable register to place result in. */
mode = TYPE_MODE (TREE_TYPE (exp));
+
+ /* Before working hard, check whether the instruction is available. */
+ if (builtin_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
+ return 0;
+
target = gen_reg_rtx (mode);
if (! flag_errno_math || ! HONOR_NANS (mode))