• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 64-bit int not being aligned in 32-bit ARM, causing crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64-bit int not being aligned in 32-bit ARM, causing crash


  • Subject: Re: 64-bit int not being aligned in 32-bit ARM, causing crash
  • From: Jonas Maebe <email@hidden>
  • Date: Wed, 11 Mar 2015 11:26:27 +0100


On 11 Mar 2015, at 11:23, Roland King wrote:


On 11 Mar 2015, at 18:13, Jonas Maebe <email@hidden> wrote:


On 06 Mar 2015, at 02:50, Jens Alfke wrote:

Shouldn’t C alignment rules dictate that the ‘value’ union and the surrounding ‘atomic_val_t’ type be 8-byte-aligned, since they contain a 64-bit integer?

Alignment rules are not dictated by the programming language, but by the ABI. The ARM ABI, and also Apple's variant, says that 64 bit integers are only guaranteed 4 byte alignment: https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html


If that's true, and read it too, the the compiler shouldn't be emitting a double word load which requires 8-byte alignment on a platform which doesn't guarantee it.

The compiler will, under normal circumstances, never by itself emit an atomic 64 bit load. My guess is that Jens is passing the address of that field to a function that is hardcoded (possibly using inline assembly) to perform a 64 bit atomic load.


Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: 64-bit int not being aligned in 32-bit ARM, causing crash
      • From: Jens Alfke <email@hidden>
References: 
 >64-bit int not being aligned in 32-bit ARM, causing crash (From: Jens Alfke <email@hidden>)
 >Re: 64-bit int not being aligned in 32-bit ARM, causing crash (From: Jonas Maebe <email@hidden>)
 >Re: 64-bit int not being aligned in 32-bit ARM, causing crash (From: Roland King <email@hidden>)

  • Prev by Date: Re: 64-bit int not being aligned in 32-bit ARM, causing crash
  • Next by Date: Re: How to debug and test a quick look generator?
  • Previous by thread: Re: 64-bit int not being aligned in 32-bit ARM, causing crash
  • Next by thread: Re: 64-bit int not being aligned in 32-bit ARM, causing crash
  • Index(es):
    • Date
    • Thread