This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Lazy construction of libcalls
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jan Hubicka" <hubicka at ucw dot cz>
- Cc: "Jan Hubicka" <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org, richard at codesourcery dot com
- Date: Tue, 4 Sep 2007 10:28:29 +0200
- Subject: Re: Lazy construction of libcalls
- References: <20070821170529.GQ27714@kam.mff.cuni.cz> <87wsvlhyds.fsf@firetop.home> <20070824135925.GB4947@kam.mff.cuni.cz> <87sl69huzx.fsf@firetop.home> <20070904081644.GB26095@atrey.karlin.mff.cuni.cz>
On 9/4/07, Jan Hubicka <hubicka@ucw.cz> wrote:
> > 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.
>
> Thanks for explanation - I've now added a guard
> if (INT_TYPE_SIZE < BITS_PER_WORD)
> into my local copy that should do what described again. I am re-testing now,
> OK with that change?
Ok.
Thanks,
Richard.