This is the mail archive of the 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: [gfortran] Fix PR15175: Type mismatch with SCALE and SET_EXPONENT

On Friday 10 December 2004 15:27, Tobias Schlüter wrote:
> SCALE and SET_EXPONENT didn't work correctly if their second rgument of
> non-default integer kinds, since we would call the same function
> irregardless of the kind of the actual argument.  The bug doesn't trigger
> on i686 due to the fact that this architecture is high endian, and the
> lower word of the argument would be read which contains the correct value. 
> This patch fixes this by converting the second argument to default integer,
> which is harmless as the result is undefined if the result overflows, and
> because default integer is always wide enough to accomodate the whole
> exponent range.
> Built and tested, I also verified the generated assembly in several cases.
> The case of set_exponent is already tested in the testsuite, and I will add
> an appropriate test for SCALE to the testsuite.
> Ok?

No. You should be converting to whatever type is used by the library 
implementation.  This means "int" for SCALE and "GFC_INTEGER_4" for 


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