This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Lazy construction of libcalls
Jan Hubicka <jh@suse.cz> writes:
>> Jan Hubicka <jh@suse.cz> writes:
>> > While comparing the tables produced by new and old code, I noticed that
>> > "ffs" for SI used to be called "ffssi3" but now it is "ffs".
>> > I believe it was inteded to be called ffs because of:
>> > optab_handler (ffs_optab, int_mode)->libfunc = init_one_libfunc ("ffs");
>> > that however later get overwriten by initialization code.
>>
>> Actually, this was deliberate. All libgccs have word and doubleword
>> ffs functions, but not all C libraries have "ffs". So we wanted the
>> libgcc versions to take precedence over the C library fallback. See:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01165.html
>>
>> for details.
>
> OK, so the initialization of libgcc always overwrite the ffs
> initialization, so simply removing the line above would work?
Not for 64-bit targets with a 32-bit int, since __builtin_ffs() takes
an int argument. We could of course add an SImode libgcc function for
those targets, but the patch above was just supposed to make better
use of what we already had.
Richard