rust/src/librustc_trans
Björn Steinbrink 78745a4afe Emit correct alignment information for loads/store of small aggregates
Loading from and storing to small aggregates happens by casting the
aggregate pointer to an appropriately sized integer pointer to avoid
the usage of first class aggregates which would lead to less optimized
code.

But this means that, for example, a tuple of type (i16, i16) will be
loading through an i32 pointer and because we currently don't provide
alignment information LLVM assumes that the load should use the ABI
alignment for i32 which would usually be 4 byte alignment. But the
alignment requirement for the (i16, i16) tuple will usually be just 2
bytes, so we're overestimating alignment, which invokes undefined
behaviour.

Therefore we must emit appropriate alignment information for
stores/loads through such casted pointers.

Fixes #23431
2015-04-18 18:32:14 +02:00
..
back Negative case of len() -> is_empty() 2015-04-14 20:26:03 -07:00
save Negative case of len() -> is_empty() 2015-04-14 20:26:03 -07:00
trans Emit correct alignment information for loads/store of small aggregates 2015-04-18 18:32:14 +02:00
lib.rs Stabilize std::convert and related code 2015-03-31 11:24:38 -07:00
README.txt

See the README.md in ../librustc.