re PR target/64240 ([AArch64] SMS-3.c causes runtime exception(segfault).)

+       PR rtl-optimization/64240
+       * ddg.c (mark_mem_use): Check *iter instead of *x.

From-SVN: r218780
This commit is contained in:
Felix Yang 2014-12-16 14:58:03 +00:00 committed by Fei Yang
parent 5007f79810
commit cc75dc899e
4 changed files with 54 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-12-16 Felix Yang <felix.yang@huawei.com>
PR rtl-optimization/64240
* ddg.c (mark_mem_use): Check *iter instead of *x.
2014-12-16 Martin Liska <mliska@suse.cz>
PR ipa/64278

View File

@ -77,7 +77,7 @@ mark_mem_use (rtx *x, void *)
{
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, *x, NONCONST)
if (MEM_P (*x))
if (MEM_P (*iter))
{
mem_ref_p = true;
break;

View File

@ -1,3 +1,8 @@
2014-12-16 Felix Yang <felix.yang@huawei.com>
PR rtl-optimization/64240
* gcc.dg/sms-12.c: New test.
2014-12-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/64244

View File

@ -0,0 +1,43 @@
/* { dg-do run } */
/* { dg-skip-if "" { ! { aarch64*-*-* } } { "*" } { "" } } */
/* { dg-options "-O2 -fmodulo-sched -funroll-loops -fdump-rtl-sms --param sms-min-sc=1 -fmodulo-sched-allow-regmoves -fPIC" } */
extern void abort (void);
int X[1000]={0};
int Y[1000]={0};
extern void abort (void);
__attribute__ ((noinline))
int
foo (int len, long a)
{
int i;
long res = a;
len = 1000;
for (i = 0; i < len; i++)
res += X[i]* Y[i];
if (res != 601)
abort ();
}
int
main ()
{
X[0] = Y[1] = 2;
Y[0] = X[1] = 21;
X[2] = Y[3] = 3;
Y[2] = X[3] = 31;
X[4] = Y[5] = 4;
Y[4] = X[5] = 41;
foo (6, 3);
return 0;
}
/* { dg-final { cleanup-rtl-dump "sms" } } */