Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Data layout specification is incompatible with atomic loads and stores #214

Closed
shepmaster opened this issue Jun 15, 2016 · 7 comments
Closed

Comments

@shepmaster
Copy link

Rust generates atomic loads and stores using the alignment specified by the data layout. However, it's forbidden to load from e.g. a 16-bit value with less than 16-bits of alignment.

This can be fixed by changing the data layout:

e-p:16:16:16-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-n8

Although I'm not sure what all potential fallout this might have (#213 maybe?)

@rjordans
Copy link

Do we want/have the floating point specified in the above data layout yet?

@shepmaster
Copy link
Author

shepmaster commented Jun 15, 2016

@rjordans ¯_(ツ)_/¯ It's already there in some form.

@dylanmckay
Copy link
Member

This seems like a good idea. Would like to wait until you updated #213 so I can check it fixes it.

@shepmaster
Copy link
Author

Would like to wait until you updated #213 so I can check it fixes it.

Oh, #213 happens after I've made this change locally; I'm worried that this change causes that issue. Still trying to reproduce and reduce that issue :-)

@Amanieu
Copy link

Amanieu commented Aug 13, 2016

Since avr doesn't support atomic operations you should add "max-atomic-width": 0 to the Rust target specification. This will disable atomic types in libcore.

@shepmaster
Copy link
Author

Since avr doesn't support atomic operations you should add "max-atomic-width": 0 to the Rust target specification. This will disable atomic types in libcore.

We actually have some minimal emulation of atomic types: disable interrupts, perform the operation, re-enable interrupts.

@dylanmckay
Copy link
Member

Fixed in 5f12f20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants