Skip to content

Commit 20ebcaf

Browse files
committed
middle-end/114734 - wrong code with expand_call_mem_ref
When expand_call_mem_ref looks at the definition of the address argument to eventually expand a &TARGET_MEM_REF argument together with a masked load it fails to honor constraints imposed by SSA coalescing decisions. The following fixes this. PR middle-end/114734 * internal-fn.cc (expand_call_mem_ref): Use get_gimple_for_ssa_name to get at the def stmt of the address argument to honor SSA coalescing constraints. (cherry picked from commit 4d3a561)
1 parent c479531 commit 20ebcaf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gcc/internal-fn.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see
5252
#include "explow.h"
5353
#include "rtl-iter.h"
5454
#include "gimple-range.h"
55+
#include "tree-ssa-live.h"
56+
#include "tree-outof-ssa.h"
5557

5658
/* For lang_hooks.types.type_for_mode. */
5759
#include "langhooks.h"
@@ -2771,8 +2773,8 @@ expand_call_mem_ref (tree type, gcall *stmt, int index)
27712773
tree tmp = addr;
27722774
if (TREE_CODE (tmp) == SSA_NAME)
27732775
{
2774-
gimple *def = SSA_NAME_DEF_STMT (tmp);
2775-
if (gimple_assign_single_p (def))
2776+
gimple *def = get_gimple_for_ssa_name (tmp);
2777+
if (def && gimple_assign_single_p (def))
27762778
tmp = gimple_assign_rhs1 (def);
27772779
}
27782780

0 commit comments

Comments
 (0)