From: Bin Cheng Date: Tue, 30 Oct 2012 02:17:50 +0000 (+0000) Subject: re PR target/54989 (FAIL: gcc.dg/hoist-register-pressure.c scan-rtl-dump hoist "PRE... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d863d14312412121fc138f607258e7a86e72a7a8;p=gcc.git re PR target/54989 (FAIL: gcc.dg/hoist-register-pressure.c scan-rtl-dump hoist "PRE/HOIST: end of bb .* copying expression" on darwin) PR target/54989 * gcc.dg/hoist-register-pressure-1.c: Rename from hoist-register-pressure.c. Add nonpic condition. * gcc.dg/hoist-register-pressure-2.c: New testcase. From-SVN: r192976 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6a81221005..627d80ddb37 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2012-10-30 Bin Cheng + + PR target/54989 + * gcc.dg/hoist-register-pressure-1.c: Rename from + hoist-register-pressure.c. Add nonpic condition. + * gcc.dg/hoist-register-pressure-2.c: New testcase. + 2012-10-29 Jonathan Wakely PR c++/54930 diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c new file mode 100644 index 00000000000..01e5ed4fbb5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c @@ -0,0 +1,31 @@ +/* { dg-options "-Os -fdump-rtl-hoist" } */ +/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */ + +#define BUF 100 +int a[BUF]; + +void com (int); +void bar (int); + +int foo (int x, int y, int z) +{ + /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled, + because its rtx_cost is too small. */ + if (z) + { + a[1] = a[0] + a[2]; + a[2] = a[1] + a[3]; + a[3] = a[2] + a[4]; + a[4] = a[3] + a[5]; + a[5] = a[4] + a[6]; + a[6] = a[5] + a[7]; + a[7] = a[6] + a[8]; + com (x+y); + } + else + { + bar (x+y); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c new file mode 100644 index 00000000000..7f973fec575 --- /dev/null +++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c @@ -0,0 +1,32 @@ +/* { dg-options "-Os -fdump-rtl-hoist" } */ +/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */ + +#define BUF 100 +int a[BUF]; + +void com (int); +void bar (int); + +int foo (int x, int y, int z) +{ + /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled, + because its rtx_cost is too small. */ + if (z) + { + a[1] = a[0]; + a[2] = a[1]; + a[3] = a[3]; + a[4] = a[5]; + a[5] = a[7]; + a[6] = a[11]; + a[7] = a[13]; + a[8] = a[17]; + com (x+y); + } + else + { + bar (x+y); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure.c b/gcc/testsuite/gcc.dg/hoist-register-pressure.c deleted file mode 100644 index 6077f1e5782..00000000000 --- a/gcc/testsuite/gcc.dg/hoist-register-pressure.c +++ /dev/null @@ -1,31 +0,0 @@ -/* { dg-options "-Os -fdump-rtl-hoist" } */ -/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */ - -#define BUF 100 -int a[BUF]; - -void com (int); -void bar (int); - -int foo (int x, int y, int z) -{ - /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled, - because its rtx_cost is too small. */ - if (z) - { - a[1] = a[0] + a[2]; - a[2] = a[1] + a[3]; - a[3] = a[2] + a[4]; - a[4] = a[3] + a[5]; - a[5] = a[4] + a[6]; - a[6] = a[5] + a[7]; - a[7] = a[6] + a[8]; - com (x+y); - } - else - { - bar (x+y); - } - - return 0; -}