public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-60] middle-end/114734 - wrong code with expand_call_mem_ref
@ 2024-04-30  6:46 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2024-04-30  6:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4d3a5618de5a949c61605f545f90e81bc0000502

commit r15-60-g4d3a5618de5a949c61605f545f90e81bc0000502
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Apr 26 15:47:13 2024 +0200

    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.

Diff:
---
 gcc/internal-fn.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc
index 2c764441cde..0a7053c2286 100644
--- a/gcc/internal-fn.cc
+++ b/gcc/internal-fn.cc
@@ -53,6 +53,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "rtl-iter.h"
 #include "gimple-range.h"
 #include "fold-const-call.h"
+#include "tree-ssa-live.h"
+#include "tree-outof-ssa.h"
 
 /* For lang_hooks.types.type_for_mode.  */
 #include "langhooks.h"
@@ -2964,8 +2966,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);
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-30  6:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30  6:46 [gcc r15-60] middle-end/114734 - wrong code with expand_call_mem_ref Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).