]> granicus.if.org Git - clang/commit
findDominatingStoreToReturn in CGCall.cpp didn't check if a candidate store
authorJakub Kuderski <jakub.kuderski@arm.com>
Tue, 8 Sep 2015 10:36:42 +0000 (10:36 +0000)
committerJakub Kuderski <jakub.kuderski@arm.com>
Tue, 8 Sep 2015 10:36:42 +0000 (10:36 +0000)
commit97a0d7a85acc1a6fa3f88b4ed7f6ee5cb615dda1
treec565cc9a067c17d1ceb02886cd1e8ac103bb1b5a
parent729351e03fe4c64056308de5ee6d28f654ba73b6
findDominatingStoreToReturn in CGCall.cpp didn't check if a candidate store
instruction used the ReturnValue as pointer operand or value operand. This
led to wrong code gen - in later stages (load-store elision code) the found
store and its operand would be erased, causing ReturnValue to become a <badref>.

The patch adds a check that makes sure that ReturnValue is a pointer operand of
store instruction. Regression test is also added.

This fixes PR24386.
Differential Revision: http://reviews.llvm.org/D12400

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247003 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
test/CodeGen/arm_function_epilog.cpp [new file with mode: 0644]