Handle the same VALUE for true dependence.
gcc/ 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. gcc/testsuite/ 2010-05-04 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/43671 * gcc.target/i386/pr43671.c: New. From-SVN: r159033
This commit is contained in:
parent
85912441e4
commit
2147c71c10
@ -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
|
||||
|
39
gcc/alias.c
39
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)
|
||||
{
|
||||
|
@ -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
|
||||
|
27
gcc/testsuite/gcc.target/i386/pr43671.c
Normal file
27
gcc/testsuite/gcc.target/i386/pr43671.c
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user