[polly] r246396 - Do not store into a temporary twine

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 09:04:02 PDT 2015


On Sun, Aug 30, 2015 at 12:51 PM, Tobias Grosser via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grosser
> Date: Sun Aug 30 14:51:01 2015
> New Revision: 246396
>
> URL: http://llvm.org/viewvc/llvm-project?rev=246396&view=rev
> Log:
> Do not store into a temporary twine
>
> For some reason, this causes memory corruption issues. Let's just avoid it.
>

Twines are not designed to be named, as such.

A Twine expresion stores references to Twine subexpressions that are local
to the C++ full expression - once you are outside that full expression
those references are dangling (as the subexpression Twines are out of
scope).


>
> Modified:
>     polly/trunk/lib/CodeGen/BlockGenerators.cpp
>
> Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=246396&r1=246395&r2=246396&view=diff
>
> ==============================================================================
> --- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
> +++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Sun Aug 30 14:51:01 2015
> @@ -401,8 +401,8 @@ void BlockGenerator::generateScalarLoads
>        continue;
>
>      auto *Address = getOrCreateAlloca(MA);
> -    auto Name = Address->getName() + ".reload";
> -    BBMap[MA.getBaseAddr()] = Builder.CreateLoad(Address, Name);
> +    BBMap[MA.getBaseAddr()] =
> +        Builder.CreateLoad(Address, Address->getName() + ".reload");
>    }
>  }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150831/4a64b5d4/attachment.html>


More information about the llvm-commits mailing list