On 25 August 2011 18:31, Julian Brown <jul...@codesourcery.com> wrote: > On Thu, 25 Aug 2011 16:46:50 +0100 > Julian Brown <jul...@codesourcery.com> wrote: > >> So, OK to apply this version, assuming testing comes out OK? (And the >> followup patch [2/2], which remains unchanged?) > > FWIW, all tests pass, apart from gcc.target/arm/volatile-bitfields-3.c, > which regresses. The output contains: > > ldrh r0, [r3, #2] @ unaligned > > I believe that, to conform to the ARM EABI, that GCC must use an > (aligned) ldr in this case. Is that correct?
That is correct by my reading of the ABI Spec. The relevant section is 7.1.7.5 where it states that : "When a volatile bitfield is read it's container must be read exactly once using the access width appropriate to the type of the container. " Here the type of the container is a long and hence the access should be with an ldr instruction followed by a shift as it is today irrespective whether we support unaligned accesses in this case. cheers Ramana