From: Felix Yang Date: Tue, 16 Dec 2014 14:58:03 +0000 (+0000) Subject: re PR target/64240 ([AArch64] SMS-3.c causes runtime exception(segfault).) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc75dc899e40ba3ea2d6f7532a472978c0e65b80;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff5a146ea54..4b134ad0519 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-16 Felix Yang + + PR rtl-optimization/64240 + * ddg.c (mark_mem_use): Check *iter instead of *x. + 2014-12-16 Martin Liska PR ipa/64278 diff --git a/gcc/ddg.c b/gcc/ddg.c index b370d512e78..2dd39f30a1c 100644 --- a/gcc/ddg.c +++ b/gcc/ddg.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0034d0a5b42..47565a2f465 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-16 Felix Yang + + PR rtl-optimization/64240 + * gcc.dg/sms-12.c: New test. + 2014-12-16 Janus Weil PR fortran/64244 diff --git a/gcc/testsuite/gcc.dg/sms-12.c b/gcc/testsuite/gcc.dg/sms-12.c new file mode 100644 index 00000000000..23cff3b137a --- /dev/null +++ b/gcc/testsuite/gcc.dg/sms-12.c @@ -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" } } */ +