public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Do not directly change TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr
@ 2017-06-15 13:51 Eric Botcazou
  2017-06-16  7:51 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2017-06-15 13:51 UTC (permalink / raw)
  To: gcc-patches

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-16 10:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 13:51 [patch] Do not directly change TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr Eric Botcazou
2017-06-16  7:51 ` Richard Biener
2017-06-16 10:26   ` Eric Botcazou
2017-06-16 10:46     ` 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).