This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



On Mar 28, 2005, at 2:21 PM, Richard Henderson wrote:


On Thu, Mar 24, 2005 at 09:38:25AM -0800, Fariborz Jahanian wrote:
+   /* mode of the 2nd argument must match Wtype. */
+   mode2 = mode_for_size (INT_TYPE_SIZE, MODE_INT, 0);

Why do you believe Wtype == int?

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').
INT_TYPE_SIZE is the size for a C expression in bits of the type `int' on the
target machine. It is 32 for both rs6000 and i386. Also, it
has already been used in at least one other place where return type of "int" is desitred;
(in __ffs*). So, it seems to me that at least in the case of __powi* functions, INT_TYPE_SIZE is the natural
choice when formal argument's type is Wtype.
Ideally, formal argument information should be available when call to the function is
generated. In the case of libgcc functions, they are not.
This can be done, but it is not worth the amount of change required for this special case where
'word_mode' has been used incorrectly in setting up the call.


- fariborz



This is *not* ok.



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]