summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/alias.c39
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr43671.c27
4 files changed, 73 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b792a5301a7..a93e1117e38 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/43671
+ * alias.c (true_dependence): Handle the same VALUE in x and mem.
+ (canon_true_dependence): Likewise.
+ (write_dependence_p): Likewise.
+
2010-05-04 Jan Hubicka <jh@suse.cz>
* Makefile.in (cgraphbuild.o): Add dependency on ipa-utils.h
diff --git a/gcc/alias.c b/gcc/alias.c
index baf0a62971e..1d69d9da603 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2357,8 +2357,18 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x,
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
- x_addr = get_addr (XEXP (x, 0));
- mem_addr = get_addr (XEXP (mem, 0));
+ x_addr = XEXP (x, 0);
+ mem_addr = XEXP (mem, 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);
+ mem_addr = get_addr (mem_addr);
+ }
base = find_base_term (x_addr);
if (base && (GET_CODE (base) == LABEL_REF
@@ -2440,7 +2450,16 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
return 1;
if (! x_addr)
- x_addr = get_addr (XEXP (x, 0));
+ {
+ 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 (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;
@@ -2509,8 +2528,18 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep)
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
return 1;
- x_addr = get_addr (XEXP (x, 0));
- mem_addr = get_addr (XEXP (mem, 0));
+ x_addr = XEXP (x, 0);
+ mem_addr = XEXP (mem, 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);
+ mem_addr = get_addr (mem_addr);
+ }
if (! writep)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d43de64bde4..5822278f3b9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/43671
+ * gcc.target/i386/pr43671.c: New.
+
2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/43705
diff --git a/gcc/testsuite/gcc.target/i386/pr43671.c b/gcc/testsuite/gcc.target/i386/pr43671.c
new file mode 100644
index 00000000000..958eaff4453
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr43671.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-mtune=i686 -O1 -fpeel-loops -fschedule-insns2 -ftree-vectorize -fsched2-use-superblocks" } */
+
+extern void abort ();
+
+int main ()
+{
+ struct {
+ char ca[16];
+ } s;
+ int i;
+
+ for (i = 0; i < 16; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+
+ for (i = 0; i < 16; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}