[PATCH] [ARM] Align stack objects passed to memory intrinsics
John Brawn
john.brawn at arm.com
Wed Mar 11 04:03:45 PDT 2015
REPOSITORY
rL LLVM
================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:1252
@@ +1251,3 @@
+ AI->getAlignment() < PrefAlign &&
+ TD->getTypeAllocSize(AI->getAllocatedType()) - Offset2 >= MinSize)
+ AI->setAlignment(PrefAlign);
----------------
hfinkel wrote:
> If this is not an inbounds GEP, then this subtraction could underflow (it could overflow otherwise too, but without inbounds it could underflow even in a case where the code does not have undefined behavior). I recommend making sure the value being subtracted is not greater than the alloc size.
>
> Please add a test case for this.
>
stripAndAccumulateInBoundsConstantOffsets will stop if it hits a non-inbound GEP, so we wouldn't get here in that case. Adding a test sound like a good idea though, I'll do that.
http://reviews.llvm.org/D7908
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list