diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2015-04-15 20:14:54 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2015-04-18 18:32:14 +0200 |
| commit | 78745a4afe90fc5f24b9fa3af6a31551859419f8 (patch) | |
| tree | 48bd308ab7f04a46b62217c3f0067cc10e07cd8d /src/rustllvm/ExecutionEngineWrapper.cpp | |
| parent | fcf637b19f1a94dcf1748b8b29fca100f150eb0a (diff) | |
| download | rust-78745a4afe90fc5f24b9fa3af6a31551859419f8.tar.gz rust-78745a4afe90fc5f24b9fa3af6a31551859419f8.zip | |
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
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
