aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-04-24 06:46:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-04-24 06:46:37 +0000
commitaeed4133ae44ea4861779bfa96b22fcd8c951102 (patch)
treea629a926e2e9585780381bf17827c92805eac49d
parent7f9844caf1ebd513d8720afa3ce857fada9e94c6 (diff)
downloadgcc-aeed4133ae44ea4861779bfa96b22fcd8c951102.zip
gcc-aeed4133ae44ea4861779bfa96b22fcd8c951102.tar.gz
gcc-aeed4133ae44ea4861779bfa96b22fcd8c951102.tar.bz2
optabs.c (set_conv_libfunc): Prefer libgcc2's __ffsMM2 functions over an external ffs function.
gcc/ * optabs.c (set_conv_libfunc): Prefer libgcc2's __ffsMM2 functions over an external ffs function. From-SVN: r124096
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/optabs.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3983b42..b77b42d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-24 Richard Sandiford <richard@codesourcery.com>
+
+ * optabs.c (set_conv_libfunc): Prefer libgcc2's __ffsMM2 functions
+ over an external ffs function.
+
2007-04-24 Chao-ying Fu <fu@mips.com>
Richard Sandiford <richard@nildram.co.uk>
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 49e0121..b63accc 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5411,6 +5411,7 @@ void
init_optabs (void)
{
unsigned int i;
+ enum machine_mode int_mode;
/* Start by initializing all tables to contain CODE_FOR_nothing. */
@@ -5620,6 +5621,11 @@ init_optabs (void)
/* Fill in the optabs with the insns we support. */
init_all_optabs ();
+ /* The ffs function operates on `int'. Fall back on it if we do not
+ have a libgcc2 function for that width. */
+ int_mode = mode_for_size (INT_TYPE_SIZE, MODE_INT, 0);
+ ffs_optab->handlers[(int) int_mode].libfunc = init_one_libfunc ("ffs");
+
/* Initialize the optabs with the names of the library functions. */
init_integral_libfuncs (add_optab, "add", '3');
init_floating_libfuncs (add_optab, "add", '3');
@@ -5731,10 +5737,6 @@ init_optabs (void)
abs_optab->handlers[TYPE_MODE (complex_double_type_node)].libfunc
= init_one_libfunc ("cabs");
- /* The ffs function operates on `int'. */
- ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)].libfunc
- = init_one_libfunc ("ffs");
-
abort_libfunc = init_one_libfunc ("abort");
memcpy_libfunc = init_one_libfunc ("memcpy");
memmove_libfunc = init_one_libfunc ("memmove");