------- Comment #23 from rguenther at suse dot de 2008-06-25 21:48 ------- Subject: Re: [4.4 Regression] FAIL: gcc.c-torture/execute/20040709-1.c execution at -O2 and above
On Wed, 25 Jun 2008, aoliva at gcc dot gnu dot org wrote: > ------- Comment #22 from aoliva at gcc dot gnu dot org 2008-06-25 20:20 > ------- > Sorry that it took me so long to look at this. > > Richi, I have a feeling that your patch will just paper over the problem. I know. > See, if we take a bit-range that's not the entire bit-field, it will emit the > same shifts, and it will break in the same way. > > The problem is that there's a disconnect between the width of the underlying > mode/type and the width of the variable in which it is held. > > When I introduced bit-fields in SRA, one of my goals was to introduce scalars > for "remaining" fields (i.e., those that didn't get scalar versions of their > own) in such a way that no extraneous shifting was needed: we'd just extract > the bits without shifting them around, for this would be just wasted > computation. It sufficed to apply masks to recombine these remaining fields > into their proper place. > > Now, when you changed type from a mode-sized type to a nonstandard > bitfield-sized type and replaced some bitfield references with plain > conversions, you broke this property and removed the fix-ups that would have > taken care of ensuring the shifts (if any) matched. The _result_ type is what I changed. The result type of a BIT_FIELD_REF needs to match the bitfield width. If you can point out where I changed the field type that is referenced then you have found the error. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35518