public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7932] rtl-optimization/105091 - wrong DSE with missed TREE_ADDRESSABLE
@ 2022-03-31  7:19 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-03-31  7:19 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b75f996e846d079251f3a6134617f0405c3ed535

commit r12-7932-gb75f996e846d079251f3a6134617f0405c3ed535
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Mar 31 08:20:43 2022 +0200

    rtl-optimization/105091 - wrong DSE with missed TREE_ADDRESSABLE
    
    When expanding an aggregate copy into a memcpy call RTL expansion
    uses mark_addressable to ensure the base object is addressable but
    that function doesn't handle TARGET_MEM_REF bases.  Fixed as follows.
    
    2022-03-31  Richard Biener  <rguenther@suse.de>
    
            PR rtl-optimization/105091
            * gimple-expr.cc (mark_addressable): Handle TARGET_MEM_REF
            bases.

Diff:
---
 gcc/gimple-expr.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc
index f9a650b5daf..5faaf43eaf5 100644
--- a/gcc/gimple-expr.cc
+++ b/gcc/gimple-expr.cc
@@ -910,7 +910,8 @@ mark_addressable (tree x)
     x = TREE_OPERAND (x, 0);
   while (handled_component_p (x))
     x = TREE_OPERAND (x, 0);
-  if (TREE_CODE (x) == MEM_REF
+  if ((TREE_CODE (x) == MEM_REF
+       || TREE_CODE (x) == TARGET_MEM_REF)
       && TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
     x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
   if (!VAR_P (x)


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

only message in thread, other threads:[~2022-03-31  7:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  7:19 [gcc r12-7932] rtl-optimization/105091 - wrong DSE with missed TREE_ADDRESSABLE 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).