This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How does builtin_sqrt get used - or not
- From: Ian Lance Taylor <iant at google dot com>
- To: Andrew Hutchinson <andrewhutchinson at cox dot net>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Sat, 21 Nov 2009 18:14:16 -0800
- Subject: Re: How does builtin_sqrt get used - or not
- References: <4B085C05.4030308@cox.net>
Andrew Hutchinson <andrewhutchinson@cox.net> writes:
> I am tracking test failure with avr target where function sqrtf is
> undefined reference at link time.
>
> Here is command line:
>
> /media/verbatim/gcchead/obj-dir/gcc/xgcc
> -B/media/verbatim/gcchead/obj-dir/gcc/
> /media/verbatim/gcchead/trunk/gcc/testsuite/gcc.dg/pr41963.c -O2
> -ffast-math -DSTACK_SIZE=2048 -DNO_TRAMPOLINES -DSIGNAL_SUPPRESS
> -mmcu=atmega128 /home/andy/winavrfiles/avrtest/dejagnuboards/exit.c
> -Wl,-u,vfprintf -lprintf_flt
> -Wl,-Tbss=0x802000,--defsym=__heap_end=0x80ffff -lm -o pr41963.exe
>
> I am lead to believe that gcc might use builtin_sqrtf rather than
> sqrtf(). I am successfully using fabsf() - with no link errors.
>
> Is their any target configuration needed for builtin_sqrtf that I
> should know about ?
If your target does not define a sqrtsf2 insn, then using
builtin_sqrtf won't make any difference; gcc will still call the
libc's sqrtf function.
Ian