diff options
author | Richard Biener <rguenther@suse.de> | 2024-04-26 15:47:13 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-05-06 14:08:28 +0200 |
commit | 20ebcaf826c91ddaf2aac35417ec1e5e6d31ad50 (patch) | |
tree | ec5a24b190e93c2ee4619f234c8a72048d582aae | |
parent | c4795316b2d92c9edd3d86ffa11425c82d1e379c (diff) |
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 4d3a5618de5a949c61605f545f90e81bc0000502)
-rw-r--r-- | gcc/internal-fn.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc index c8943e6cb9e..0ff69a9dce8 100644 --- a/gcc/internal-fn.cc +++ b/gcc/internal-fn.cc @@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see #include "explow.h" #include "rtl-iter.h" #include "gimple-range.h" +#include "tree-ssa-live.h" +#include "tree-outof-ssa.h" /* For lang_hooks.types.type_for_mode. */ #include "langhooks.h" @@ -2771,8 +2773,8 @@ expand_call_mem_ref (tree type, gcall *stmt, int index) tree tmp = addr; if (TREE_CODE (tmp) == SSA_NAME) { - gimple *def = SSA_NAME_DEF_STMT (tmp); - if (gimple_assign_single_p (def)) + gimple *def = get_gimple_for_ssa_name (tmp); + if (def && gimple_assign_single_p (def)) tmp = gimple_assign_rhs1 (def); } |