This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Obvious expand_builtin_mathfn improvement installed
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com, roger at eyesopen dot com
- Date: Sun, 29 Jun 2003 23:10:07 +0200
- Subject: Obvious expand_builtin_mathfn improvement installed
Hi,
I am installing the atached patch as obvious. It avoid
expand_builtin_mathfn(_2) from doing the busy work of creating dummy
seqeuences, stablizing and expanding operands when the builtin is not
supported by target.
The main motivation is however to mask the bug that previously shown up
as eon misscopmilation. This bug makes periodic testers to loop forever
disturbing them completely. Recently the tree is changing rapidly and
it is quite neccesary to have it logged.
Honza
Sun Jun 29 23:06:01 CEST 2003 Jan Hubicka <jh@suse.cz>
* builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid
busy work when builtin is not supported by the backend.
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.222
diff -c -3 -p -r1.222 builtins.c
*** builtins.c 25 Jun 2003 03:09:02 -0000 1.222
--- builtins.c 25 Jun 2003 12:22:53 -0000
*************** expand_builtin_mathfn (tree exp, rtx tar
*** 1766,1771 ****
--- 1766,1775 ----
/* 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))
*************** expand_builtin_mathfn_2 (tree exp, rtx t
*** 1861,1866 ****
--- 1865,1875 ----
/* 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))