public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-870] operand scanner TLC
@ 2021-05-18  9:35 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-05-18  9:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3e2c715823e6aa0bfd89e56046a1c237789cd27d

commit r12-870-g3e2c715823e6aa0bfd89e56046a1c237789cd27d
Author: Richard Biener <rguenther@suse.de>
Date:   Tue May 18 11:33:29 2021 +0200

    operand scanner TLC
    
    This applies some TLC to mark_address_taken which ends up setting
    TREE_ADDRESSABLE on nodes where it doesn't have any semantics.
    It also does work (incomplete) that get_base_address already does,
    likewise we'll never get WITH_SIZE_EXPR in this context and thus
    get_base_address never fails.
    
    2021-05-18  Richard Biener  <rguenther@suse.de>
    
            * tree-ssa-operands.c (mark_address_taken): Simplify.

Diff:
---
 gcc/tree-ssa-operands.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 9e620883d44..2fc74d51917 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -626,15 +626,10 @@ mark_address_taken (tree ref)
      be referenced using pointer arithmetic.  See PR 21407 and the
      ensuing mailing list discussion.  */
   var = get_base_address (ref);
-  if (var)
-    {
-      if (DECL_P (var))
-	TREE_ADDRESSABLE (var) = 1;
-      else if (TREE_CODE (var) == MEM_REF
-	       && TREE_CODE (TREE_OPERAND (var, 0)) == ADDR_EXPR
-	       && DECL_P (TREE_OPERAND (TREE_OPERAND (var, 0), 0)))
-	TREE_ADDRESSABLE (TREE_OPERAND (TREE_OPERAND (var, 0), 0)) = 1;
-    }
+  if (VAR_P (var)
+      || TREE_CODE (var) == RESULT_DECL
+      || TREE_CODE (var) == PARM_DECL)
+    TREE_ADDRESSABLE (var) = 1;
 }


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

only message in thread, other threads:[~2021-05-18  9:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  9:35 [gcc r12-870] operand scanner TLC 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).