diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-04 08:32:56 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-04 08:32:56 +0000 |
commit | 48331bf4607e1df3ddcf08f030a74c326f016ed9 (patch) | |
tree | 673a8eb608a3822d1925be4d0b498edda609bb44 | |
parent | f63b3b564a92d88ec9f585d4a1093d30da5a97d6 (diff) | |
download | gcc-48331bf4607e1df3ddcf08f030a74c326f016ed9.tar.gz |
PR tree-optimization/61684
* tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure
rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it.
* gcc.c-torture/compile/pr61684.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212290 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr61684.c | 15 | ||||
-rw-r--r-- | gcc/tree-ssa-ifcombine.c | 3 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3b0f8ef6bcd..49652198a57 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-07-04 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/61684 + * tree-ssa-ifcombine.c (recognize_single_bit_test): Make sure + rhs1 of conversion is a SSA_NAME before using SSA_NAME_DEF_STMT on it. + 2014-07-04 Chung-Ju Wu <jasonwucj@gmail.com> Kito Cheng <kito@0xlab.org> Monk Chiang <sh.chiang04@gmail.com> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9ea562b78a5..5eee7179319 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-07-04 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/61684 + * gcc.c-torture/compile/pr61684.c: New test. + 2014-07-04 Thomas Schwinge <thomas@codesourcery.com> * lib/g++-dg.exp (g++-dg-runtest): Change interface to match diff --git a/gcc/testsuite/gcc.c-torture/compile/pr61684.c b/gcc/testsuite/gcc.c-torture/compile/pr61684.c new file mode 100644 index 00000000000..f5b53b73a0d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr61684.c @@ -0,0 +1,15 @@ +/* PR tree-optimization/61684 */ + +int a, c; +static int *b = 0; +short d; +static short **e = 0; + +void +foo () +{ + for (; c < 1; c++) + ; + *e = &d; + a = d && (c && 1) & *b; +} diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c index fa3c5b1cf5e..7e051a30b08 100644 --- a/gcc/tree-ssa-ifcombine.c +++ b/gcc/tree-ssa-ifcombine.c @@ -233,7 +233,8 @@ recognize_single_bit_test (gimple cond, tree *name, tree *bit, bool inv) while (is_gimple_assign (stmt) && ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) && (TYPE_PRECISION (TREE_TYPE (gimple_assign_lhs (stmt))) - <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt))))) + <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (stmt)))) + && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME) || gimple_assign_ssa_name_copy_p (stmt))) stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt)); |