From a522de151f17ef7bfe0f3a117096a4b24d0c1d35 Mon Sep 17 00:00:00 2001
From: Steven Bosscher <steven@gcc.gnu.org>
Date: Sat, 24 Jul 2010 12:37:51 +0000
Subject: [PATCH] re PR middle-end/45035 (FAIL: gcc.dg/guality/pr36728-2.c)

	PR middle-end/45035
	* alias.c (true_dependence_1): Fix thinko in merge of old
	true_dependence and canon_true_dependence.

From-SVN: r162499
---
 gcc/ChangeLog |  6 ++++++
 gcc/alias.c   | 23 ++++++++++++-----------
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cfdd938fb3e0..aa1104e1212a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-24  Steven Bosscher  <steven@gcc.gnu.org>
+
+	PR middle-end/45035
+	* alias.c (true_dependence_1): Fix thinko in merge of old
+	true_dependence and canon_true_dependence.
+
 2010-07-23  Jan Hubicka  <jh@suse.cz>
 
 	* lto-streamer-out.c (write_symbol): Fix visibilities of external
diff --git a/gcc/alias.c b/gcc/alias.c
index dd846f3c9961..9b70bb86bb26 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2375,18 +2375,19 @@ true_dependence_1 (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
     }
 
   if (! x_addr)
-    x_addr = XEXP (x, 0);
-
-  if (!((GET_CODE (x_addr) == VALUE
-	 && GET_CODE (mem_addr) != VALUE
-	 && reg_mentioned_p (x_addr, mem_addr))
-	|| (GET_CODE (x_addr) != VALUE
-	    && GET_CODE (mem_addr) == VALUE
-	    && reg_mentioned_p (mem_addr, x_addr))))
     {
-      x_addr = get_addr (x_addr);
-      if (!mem_canonicalized)
-	mem_addr = get_addr (mem_addr);
+      x_addr = XEXP (x, 0);
+      if (!((GET_CODE (x_addr) == VALUE
+	     && GET_CODE (mem_addr) != VALUE
+	     && reg_mentioned_p (x_addr, mem_addr))
+	    || (GET_CODE (x_addr) != VALUE
+		&& GET_CODE (mem_addr) == VALUE
+		&& reg_mentioned_p (mem_addr, x_addr))))
+	{
+	  x_addr = get_addr (x_addr);
+	  if (! mem_canonicalized)
+	    mem_addr = get_addr (mem_addr);
+	}
     }
 
   base = find_base_term (x_addr);
-- 
GitLab