https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107338
Kewen Lin <linkw at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |linkw at gcc dot gnu.org --- Comment #4 from Kewen Lin <linkw at gcc dot gnu.org> --- (In reply to avieira from comment #3) > Hi Kewen, > > I believe you are right. I was waiting for a powerpc machine in the board > farm, but I suspect I can reproduce this with an aarch64 BE target and I > should be able to confirm. > > But your reasoning seems valid to me. Because of the widening the shift_n > becomes 32-shift_n-mask_width, but the start of the bitfield didn't move by > widening the container, so it is still 16 - shift_n - mask_width bits away > from the start of the container. > > Moving the calculation before the widening seems like the neatest solution > to me, there's no point in keeping the old type around I think. > > Do you want to produce a patch for this, seeing you solved it? Hi Andre, Thanks for your reply! Sure, I'll make a formal patch and do further bootstrap/regtest on x86_64-redhat-linux, aarch64-linux-gnu and powerpc64{,le}-linux-gnu, and post it once the testing go well.