[PATCH] Retain alignment requirements for load->selects modified by DAGCombine

Louis Gerbarg lgg at apple.com
Wed Jul 30 10:40:02 PDT 2014


This patch fixes an issue where we can generate aligned loads for unaligned data. It is a latent bug that has been around for years, but we have started tripping it recently with the introduction of more aggressive vectorization, etc. On x86 this manifests as generating a movapd when we should have used a movupd, which then results in a segfault if the data does not happened to be aligned. The problem is in platform independent codegen, so this may manifest on other architectures as well. I suspect on PPC this may result in some subtle data corruption bugs since altivec loads will take an unaligned address without faulting and just ignore the low bits.

Tests included.

Louis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Retain-alignment-requirements-for-load-selects-modif.patch
Type: application/octet-stream
Size: 4229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140730/f5e51f55/attachment.obj>


More information about the llvm-commits mailing list