public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Use OEP_ADDRESS_OF in emit-rtl.c
@ 2015-10-07  5:29 Jan Hubicka
  2015-10-07  8:29 ` Richard Biener
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Hubicka @ 2015-10-07  5:29 UTC (permalink / raw)
  To: gcc-patches, law, rguenther

Hi,
adding some extra sanity checks to operand_equal_p made me to notice that uses
of operand_equal_p in mem attrs really care about addresses only.  The expression
is tree of the original memory acces MEM RTX was created from and thus the
comparsions should be done with OEP_ADDRESS_OF.

Bootstrapped/regtested x86_64-linux, OK?

Honza

	* emit-rtl.c (mem_attrs_eq_p, mem_expr_equal_p): Pass OEP_ADDRESS_OF
	to operand_equal_p.

Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 228131)
+++ emit-rtl.c	(working copy)
@@ -334,7 +334,7 @@ mem_attrs_eq_p (const struct mem_attrs *
 	  && p->addrspace == q->addrspace
 	  && (p->expr == q->expr
 	      || (p->expr != NULL_TREE && q->expr != NULL_TREE
-		  && operand_equal_p (p->expr, q->expr, 0))));
+		  && operand_equal_p (p->expr, q->expr, OEP_ADDRESS_OF))));
 }
 
 /* Set MEM's memory attributes so that they are the same as ATTRS.  */
@@ -1657,7 +1657,7 @@ mem_expr_equal_p (const_tree expr1, cons
   if (TREE_CODE (expr1) != TREE_CODE (expr2))
     return 0;
 
-  return operand_equal_p (expr1, expr2, 0);
+  return operand_equal_p (expr1, expr2, OEP_ADDRESS_OF);
 }
 
 /* Return OFFSET if XEXP (MEM, 0) - OFFSET is known to be ALIGN

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

end of thread, other threads:[~2015-10-10 20:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07  5:29 Use OEP_ADDRESS_OF in emit-rtl.c Jan Hubicka
2015-10-07  8:29 ` Richard Biener
2015-10-07 17:33   ` Jan Hubicka
2015-10-08  7:35     ` Richard Biener
2015-10-08 16:14       ` Jan Hubicka
2015-10-09  7:51         ` Richard Biener
2015-10-10 20:36           ` Jan Hubicka

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).