[PATCH] [ARM] Align stack objects passed to memory intrinsics

hfinkel at anl.gov hfinkel at anl.gov
Tue Mar 10 14:15:00 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);
----------------
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.

http://reviews.llvm.org/D7908

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list