[llvm] r302137 - [ArgPromotion] Fix a truncated variable

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 11:20:29 PDT 2017


On Thu, May 4, 2017 at 3:54 AM, Martin Storsjo via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: mstorsjo
> Date: Thu May  4 05:54:35 2017
> New Revision: 302137
>
> URL: http://llvm.org/viewvc/llvm-project?rev=302137&view=rev
> Log:
> [ArgPromotion] Fix a truncated variable
>
> This fixes a regression since SVN rev 273808 (which was supposed to
> not change functionality).
>
> The regression caused miscompilations (noted in the wild when targeting
> AArch64) on platforms with 32 bit long.
>
> Differential Revision: https://reviews.llvm.org/D32850
>
> Modified:
>     llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
>
> Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=302137&r1=302136&r2=302137&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Thu May  4 05:54:35 2017
> @@ -247,7 +247,7 @@ doPromotion(Function *F, SmallPtrSetImpl
>            if (!ArgIndex.second.empty()) {
>              Ops.reserve(ArgIndex.second.size());
>              Type *ElTy = V->getType();
> -            for (unsigned long II : ArgIndex.second) {
> +            for (auto II : ArgIndex.second) {
>                // Use i32 to index structs, and i64 for others (pointers/arrays).
>                // This satisfies GEP constraints.
>                Type *IdxTy =
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

Please add the testcase that caused the miscompilation.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list