public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: gcc-patches@gcc.gnu.org
Subject: [patch] Do not directly change TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr
Date: Thu, 15 Jun 2017 13:51:00 -0000	[thread overview]
Message-ID: <59903573.zuAO1vMF2R@polaris> (raw)

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

Hi,

the transformation done to TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr 
is exactly the same as one of those done in maybe_fold_tmr, the latter is 
better written and the former function calls the latter, so this patch changes 
maybe_canonicalize_mem_ref_addr to avoid touching TARGET_MEM_REF directly.

Tested on x86-64/Linux, OK for the mainline?


2017-06-15  Eric Botcazou  <ebotcazou@adacore.com>

	PR bootstrap/80897
	* gimple-fold.c (maybe_canonicalize_mem_ref_addr): Do not change
	TARGET_MEM_REF expressions directly.

-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 558 bytes --]

Index: gimple-fold.c
===================================================================
--- gimple-fold.c	(revision 249091)
+++ gimple-fold.c	(working copy)
@@ -4178,8 +4178,7 @@ maybe_canonicalize_mem_ref_addr (tree *t
 
   /* Canonicalize MEM [&foo.bar, 0] which appears after propagating
      of invariant addresses into a SSA name MEM_REF address.  */
-  if (TREE_CODE (*t) == MEM_REF
-      || TREE_CODE (*t) == TARGET_MEM_REF)
+  if (TREE_CODE (*t) == MEM_REF)
     {
       tree addr = TREE_OPERAND (*t, 0);
       if (TREE_CODE (addr) == ADDR_EXPR

             reply	other threads:[~2017-06-15 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 13:51 Eric Botcazou [this message]
2017-06-16  7:51 ` Richard Biener
2017-06-16 10:26   ` Eric Botcazou
2017-06-16 10:46     ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59903573.zuAO1vMF2R@polaris \
    --to=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).