On Wed, Jun 03, 2009 at 01:07:08PM -0700, Ian Lance Taylor wrote:

> > -     unsigned int wordnum = (backwards ? nwords - i - 1 : i);
> > +     unsigned int wordnum = (backwards
> > +                             ? GET_MODE_SIZE(fieldmode) / UNITS_PER_WORD
> > +                               - i - 1
> > +                             : i);
> >       unsigned int bit_offset = (backwards
> >                                  ? MAX ((int) bitsize - ((int) i + 1)
> >                                         * BITS_PER_WORD,
> 
> Your patch looks correct.  However, it makes me wonder how the test case
> passes on existing big-endian platforms, such as the PowerPC.  Can you
> explain how that works?

I'm not sure, but it is related to the smaller word size on my platform
and the size of the field (a 64 bit long long).

The 991118-1.c test case passes ok on my platform when the word
size is 32 or 16 bits (my processor has configurable word sizes). The only
configuration that fails is when the word size is 8 bits...

When I tried to simplify the testcase I obtained the simple assignment
problem I posted in the original mail. And that problem was visible in
both 8 and 16 bits configurations.

So I suspect the problem won't be seen on PowerPC unless someone does
TI or OI bit fields...

-- 
Stelian Pop <stel...@popies.net>

Reply via email to