diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-08-15 13:17:42 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2012-08-15 13:17:42 +0000 |
commit | 0a5f2683732f0fc6edd1367295e8a218300d01c9 (patch) | |
tree | 50cef6af829959fed0d8ae9cf5b24d10849c86d9 | |
parent | 6d67b4c74da3e8a09925f5821b6e9df3352f9934 (diff) | |
download | gcc-0a5f2683732f0fc6edd1367295e8a218300d01c9.zip gcc-0a5f2683732f0fc6edd1367295e8a218300d01c9.tar.gz gcc-0a5f2683732f0fc6edd1367295e8a218300d01c9.tar.bz2 |
re PR tree-optimization/54240 (Routine hoist_adjacent_loads does not work properly after r189366)
gcc:
2012-08-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/54240
* tree-ssa-phiopt.c (hoist_adjacent_loads): Correct test for
existence of conditional move with given mode.
gcc/testsuite:
2012-08-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/54240
* gcc.target/powerpc/pr54240.c: New test.
* gcc.target/mips/pr54240.c: Likewise.
From-SVN: r190411
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/pr54240.c | 27 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr54240.c | 27 | ||||
-rw-r--r-- | gcc/tree-ssa-phiopt.c | 3 |
5 files changed, 68 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 177b5c6..d9d091a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-08-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/54240 + * tree-ssa-phiopt.c (hoist_adjacent_loads): Correct test for + existence of conditional move with given mode. + 2012-08-15 Richard Guenther <rguenther@suse.de> * double-int.h (double_int::from_unsigned): Rename to ... diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d00816e..87b12a4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-08-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/54240 + * gcc.target/powerpc/pr54240.c: New test. + * gcc.target/mips/pr54240.c: Likewise. + 2012-08-14 Oleg Endo <olegendo@gcc.gnu.org> PR target/52933 diff --git a/gcc/testsuite/gcc.target/mips/pr54240.c b/gcc/testsuite/gcc.target/mips/pr54240.c new file mode 100644 index 0000000..e932d5e --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/pr54240.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-phiopt-details isa>=4" } */ + +typedef struct s { + int v; + int b; + struct s *l; + struct s *r; +} S; + + +int foo(S *s) +{ + S *this; + S *next; + + this = s; + if (this->b) + next = this->l; + else + next = this->r; + + return next->v; +} + +/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */ +/* { dg-final { cleanup-tree-dump "phiopt1" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pr54240.c b/gcc/testsuite/gcc.target/powerpc/pr54240.c new file mode 100644 index 0000000..3e67fd5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr54240.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -misel -fdump-tree-phiopt-details" } */ + +typedef struct s { + int v; + int b; + struct s *l; + struct s *r; +} S; + + +int foo(S *s) +{ + S *this; + S *next; + + this = s; + if (this->b) + next = this->l; + else + next = this->r; + + return next->v; +} + +/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */ +/* { dg-final { cleanup-tree-dump "phiopt1" } } */ diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 0dcfbc7..4c72915 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -1842,7 +1842,8 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1, /* Check the mode of the arguments to be sure a conditional move can be generated for it. */ - if (!optab_handler (cmov_optab, TYPE_MODE (TREE_TYPE (arg1)))) + if (optab_handler (movcc_optab, TYPE_MODE (TREE_TYPE (arg1))) + == CODE_FOR_nothing) continue; /* Both statements must be assignments whose RHS is a COMPONENT_REF. */ |