From 64e97443585c1a9c6bb7dd963122f848cf781639 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 29 Jun 2003 23:16:13 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 784d3b05078..621e59c393f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 29 23:06:32 CEST 2003 Jan Hubicka + + * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid + busy work when builtin is not supported by the backend. + 2003-06-29 Zdenek Dvorak * loop.c (count_one_set): Fix detection of registers set in more diff --git a/gcc/builtins.c b/gcc/builtins.c index 26938105a55..e8ab4d5740d 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)) -- 2.30.2