patch to fix __builtin_powi failure on apple-ppc-darwin (revised)

Richard Henderson rth@redhat.com
Tue Mar 29 22:57:00 GMT 2005


On Tue, Mar 29, 2005 at 02:44:21PM -0800, Fariborz Jahanian wrote:
> Wtype is defined  by one of DItype, SItype, HItype or QItype, all 
> integer  types of different sizes, and its selection
> is based on value of MIN_UNITS_PER_WORD. It has been used as type of 
> the 2nd formal argument to
> __powi* (which expects a type 'int').

NO.  Reread libgcc2.c -- powi* expects type "Wtype", not "int".

> Also, it has already been used in at least one other place where return
> type of "int" is desitred; (in __ffs*).

Well, that would be because __ffs *uses* "int" in libgcc2.c.  Obviously.

Your change has broken (essentially) all 64-bit ports, where Wtype is
DImode, and int is SImode.

Now, since powi is new to gcc 4.0, and 4.0 isn't released, we don't yet
have a fixed abi for this, so it would be reasonable to change the
prototype of the powi functions in libgcc2.c.  I rather assume this is
what Geoff meant when he told you to use "int" in a previous message in
this thread.


r~



More information about the Gcc-patches mailing list