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]

Re: Workaround for Sun V5.0 compiler


On Sun, Aug 29, 1999 at 09:54:52PM +1000, Michael Chamberlain wrote:
>               && (INTVAL (const_arg1)
>                   >= - (((HOST_WIDE_INT) 1)
>                         << (HOST_BITS_PER_WIDE_INT - 2) * 2 + 1)
> 
> where the expression after the unary minus is (I hope) the same as
> HOST_WIDE_INT_MAX (ie, INT_MAX, LONG_MAX, etc)- perhaps it would be

Oops- despite my hopes, the above is actually wrong :-(

              && (INTVAL (const_arg1)
                  >= - ((((HOST_WIDE_INT) 1)
                         << (HOST_BITS_PER_WIDE_INT - 2) - 1)
                        * 2 + 1)

Also, to explain why it works (and to double check that I got it right
this time around), assuming an 8 bit HOST_WIDE_INT

1 << (8 - 2)                      == 01000000
(1 << (8 - 2)) - 1                == 00111111
((1 << (8 - 2)) - 1) * 2          == 01111110
((1 << (8 - 2)) - 1) * 2 + 1      == 01111111

Sorry for the stuff up first time round,
Michael.

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