From: amker Date: Tue, 30 Oct 2012 02:17:50 +0000 (+0000) Subject: PR target/54989 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b67fa7219b607efef47e8e59212674dc5a121263;p=thirdparty%2Fgcc.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192976 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6a812210056..627d80ddb376 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.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c similarity index 92% rename from gcc/testsuite/gcc.dg/hoist-register-pressure.c rename to gcc/testsuite/gcc.dg/hoist-register-pressure-1.c index 6077f1e57822..01e5ed4fbb53 100644 --- a/gcc/testsuite/gcc.dg/hoist-register-pressure.c +++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c @@ -1,5 +1,5 @@ /* { dg-options "-Os -fdump-rtl-hoist" } */ -/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */ +/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */ #define BUF 100 int a[BUF]; 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 000000000000..7f973fec575d --- /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; +}