* [Bug c/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
@ 2007-11-23 20:01 ` sjackman at gmail dot com
2007-11-23 22:39 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: sjackman at gmail dot com @ 2007-11-23 20:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from sjackman at gmail dot com 2007-11-23 20:01 -------
It's worth noting that __ffsi2 generates terrible code on the AVR: a 194 byte
function. avr-libc also provides ffs (16-bit, not 32-bit as in __ffssi2) which
is written in assembler and 24 bytes long. As a workaround, you can force the
use of avr-libc's ffs by providing the -fno-builtin-ffs.
Cheers,
Shaun
--
sjackman at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sjackman at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
2007-11-23 20:01 ` [Bug c/34210] " sjackman at gmail dot com
@ 2007-11-23 22:39 ` rguenth at gcc dot gnu dot org
2007-12-21 22:20 ` [Bug target/34210] " rask at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-23 22:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2007-11-23 22:39 -------
Confirmed. libgcc2.c doesn't have a ffs implementation for targets with 2
byte integers.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-11-23 22:39:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
2007-11-23 20:01 ` [Bug c/34210] " sjackman at gmail dot com
2007-11-23 22:39 ` rguenth at gcc dot gnu dot org
@ 2007-12-21 22:20 ` rask at gcc dot gnu dot org
2008-01-20 4:20 ` pmarques at grupopie dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-12-21 22:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rask at gcc dot gnu dot org 2007-12-21 22:20 -------
You want something like this in libgcc/config/avr/t-avr to get the 16-bit
versions:
# Extra 16-bit integer functions.
intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _ffsXX2 _clzXX2 \
_ctzXX2 _popcountXX2
hiintfuncs16 = $(subst XX,hi,$(intfuncs16))
siintfuncs16 = $(subst XX,si,$(intfuncs16))
iter-items := $(hiintfuncs16)
iter-labels := $(siintfuncs16)
iter-sizes := $(patsubst %,2,$(siintfuncs16)) $(patsubst %,2,$(hiintfuncs16))
include $(srcdir)/empty.mk $(patsubst
%,$(srcdir)/siditi-object.mk,$(iter-items))
libgcc-objects += $(patsubst %,%$(objext),$(hiintfuncs16))
ifeq ($(enable_shared),yes)
libgcc-s-objects += $(patsubst %,%_s$(objext),$(hiintfuncs16))
endif
--
rask at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |target
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
` (2 preceding siblings ...)
2007-12-21 22:20 ` [Bug target/34210] " rask at gcc dot gnu dot org
@ 2008-01-20 4:20 ` pmarques at grupopie dot com
2008-03-23 0:24 ` hutchinsonandy at aim dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: pmarques at grupopie dot com @ 2008-01-20 4:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pmarques at grupopie dot com 2008-01-20 03:41 -------
gcc.c-torture/execute/ffs-1.c and gcc.c-torture/execute/ffs-2.c also fail with
this message. The test case gcc.c-torture/execute/builtin-bitops-1.c shows some
more similar errors:
builtin-bitops-1.c:(.text+0x6b4): undefined reference to `__popcounthi2'
builtin-bitops-1.c:(.text+0x6ee): undefined reference to `__parityhi2'
builtin-bitops-1.c:(.text+0x183e): undefined reference to `__clzhi2'
I tried to add the suggested libgcc/config/avr/t-avr. It didn't work, and I
don't know enough of gcc internals to understand what is going on.
--
pmarques at grupopie dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pmarques at grupopie dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
` (3 preceding siblings ...)
2008-01-20 4:20 ` pmarques at grupopie dot com
@ 2008-03-23 0:24 ` hutchinsonandy at aim dot com
2008-03-23 3:05 ` eric dot weddington at atmel dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-03-23 0:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from hutchinsonandy at aim dot com 2008-03-23 00:24 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2008-03/msg01341.html
--
hutchinsonandy at aim dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hutchinsonandy at aim dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
` (4 preceding siblings ...)
2008-03-23 0:24 ` hutchinsonandy at aim dot com
@ 2008-03-23 3:05 ` eric dot weddington at atmel dot com
2008-04-07 23:17 ` hutchinsonandy at gcc dot gnu dot org
2008-04-08 15:15 ` eric dot weddington at atmel dot com
7 siblings, 0 replies; 10+ messages in thread
From: eric dot weddington at atmel dot com @ 2008-03-23 3:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from eric dot weddington at atmel dot com 2008-03-23 03:04 -------
*** Bug 35508 has been marked as a duplicate of this bug. ***
--
eric dot weddington at atmel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dmixm at marine dot febras
| |dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
` (5 preceding siblings ...)
2008-03-23 3:05 ` eric dot weddington at atmel dot com
@ 2008-04-07 23:17 ` hutchinsonandy at gcc dot gnu dot org
2008-04-08 15:15 ` eric dot weddington at atmel dot com
7 siblings, 0 replies; 10+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2008-04-07 23:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from hutchinsonandy at gcc dot gnu dot org 2008-04-07 23:16 -------
Subject: Bug 34210
Author: hutchinsonandy
Date: Mon Apr 7 23:15:35 2008
New Revision: 133993
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133993
Log:
PR target/34210 PR target/35508 * config.host (avr-*-*): Add avr cpu_type and
avr tmake_file. * config/t-avr: New file. Build 16bit libgcc functions.
Added:
trunk/libgcc/config/avr/
trunk/libgcc/config/avr/t-avr
Modified:
trunk/libgcc/ChangeLog
trunk/libgcc/config.host
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/34210] ffs builtin calls undefined __ffshi2
2007-11-23 19:38 [Bug c/34210] New: ffs builtin calls undefined __ffshi2 sjackman at gmail dot com
` (6 preceding siblings ...)
2008-04-07 23:17 ` hutchinsonandy at gcc dot gnu dot org
@ 2008-04-08 15:15 ` eric dot weddington at atmel dot com
7 siblings, 0 replies; 10+ messages in thread
From: eric dot weddington at atmel dot com @ 2008-04-08 15:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from eric dot weddington at atmel dot com 2008-04-08 15:14 -------
Commit from Andy fixes the bug.
--
eric dot weddington at atmel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
^ permalink raw reply [flat|nested] 10+ messages in thread