Message ID | 20111116085109.E1D5E20CE9@atree.mtv.corp.google.com |
---|---|
State | New |
Headers | show |
On Wed, Nov 16, 2011 at 03:51, Doug Kwan <dougkwan@google.com> wrote: > This patch backports the upstream fix in r171347 for a problem caused by > change in volatile bitfield access. This is tested by building the > x86 toolchain with tests and checking that volatile bitfield access worked > on ARM. This is a backport for 4.6 only. > > 2011-11-16 Doug Kwan <dougkwan@google.com> > > Backport r171347 from trunk. > > 2011-03-23 Julian Brown <julian@codesourcery.com> > > * expr.c (expand_expr_real_1): Only use BLKmode for volatile > accesses which are not naturally aligned. OK. Were there any testsuite changes for this patch? Diego.
On 16/11/11 08:51, Doug Kwan wrote: > This patch backports the upstream fix in r171347 for a problem caused by > change in volatile bitfield access. This is tested by building the > x86 toolchain with tests and checking that volatile bitfield access worked > on ARM. This is a backport for 4.6 only. > > 2011-11-16 Doug Kwan <dougkwan@google.com> > > Backport r171347 from trunk. > > 2011-03-23 Julian Brown <julian@codesourcery.com> > > * expr.c (expand_expr_real_1): Only use BLKmode for volatile > accesses which are not naturally aligned. > So Joey Ye posted the following patch, which I think is needed to fix a regression that that patch introduces. http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01390.html However, it's not been reviewed yet :-( R.
Thanks Richard. I will wait for that patch. -Doug On Wed, Nov 16, 2011 at 8:41 AM, Richard Earnshaw <rearnsha@arm.com> wrote: > On 16/11/11 08:51, Doug Kwan wrote: >> This patch backports the upstream fix in r171347 for a problem caused by >> change in volatile bitfield access. This is tested by building the >> x86 toolchain with tests and checking that volatile bitfield access worked >> on ARM. This is a backport for 4.6 only. >> >> 2011-11-16 Doug Kwan <dougkwan@google.com> >> >> Backport r171347 from trunk. >> >> 2011-03-23 Julian Brown <julian@codesourcery.com> >> >> * expr.c (expand_expr_real_1): Only use BLKmode for volatile >> accesses which are not naturally aligned. >> > So Joey Ye posted the following patch, which I think is needed to fix a > regression that that patch introduces. > > http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01390.html > > However, it's not been reviewed yet :-( > > R. > >
Index: gcc/expr.c =================================================================== --- gcc/expr.c (revision 181400) +++ gcc/expr.c (working copy) @@ -9200,8 +9200,11 @@ && modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER) /* If the field is volatile, we always want an aligned - access. */ - || (volatilep && flag_strict_volatile_bitfields > 0) + access. Only do this if the access is not already naturally + aligned, otherwise "normal" (non-bitfield) volatile fields + become non-addressable. */ + || (volatilep && flag_strict_volatile_bitfields > 0 + && (bitpos % GET_MODE_ALIGNMENT (mode) != 0)) /* If the field isn't aligned enough to fetch as a memref, fetch it as a bit field. */ || (mode1 != BLKmode