diff options
author | Richard Biener <rguenther@suse.de> | 2016-01-13 08:27:42 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-01-13 08:27:42 +0000 |
commit | 40311329e533c52c4a7c8ee5b630c7a5df38a108 (patch) | |
tree | 2aeaaf132c3d5cff3f821bd047e467662849b42c /gcc | |
parent | ccbd710399f78a99fa8fafd1d6dac02985d95666 (diff) | |
download | gcc-40311329e533c52c4a7c8ee5b630c7a5df38a108.zip gcc-40311329e533c52c4a7c8ee5b630c7a5df38a108.tar.gz gcc-40311329e533c52c4a7c8ee5b630c7a5df38a108.tar.bz2 |
re PR tree-optimization/69242 (ICE in visit_reference_op_load, at tree-ssa-sccvn.c:3224)
2016-01-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/69242
* tree-ssa-sccvn.c (visit_reference_op_load): Replace bogus
assert with a check.
* gcc.dg/torture/pr69242.c: New testcase.
From-SVN: r232315
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr69242.c | 15 | ||||
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 7 |
4 files changed, 31 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cb2ec45..e7e3601 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-01-13 Richard Biener <rguenther@suse.de> + PR tree-optimization/69242 + * tree-ssa-sccvn.c (visit_reference_op_load): Replace bogus + assert with a check. + +2016-01-13 Richard Biener <rguenther@suse.de> + PR tree-optimization/69186 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Properly guard vect_update_misalignment_for_peel call. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ce47d4..4568a636 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2016-01-13 Richard Biener <rguenther@suse.de> + PR tree-optimization/69242 + * gcc.dg/torture/pr69242.c: New testcase. + +2016-01-13 Richard Biener <rguenther@suse.de> + PR tree-optimization/69186 * gcc.dg/torture/pr69186.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr69242.c b/gcc/testsuite/gcc.dg/torture/pr69242.c new file mode 100644 index 0000000..d7f1718 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr69242.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-w" } */ + +int a[1]; +void *memcpy(); +int smx_ctx_base_factory_create_context_sized(); +void getcontext(); +void smx_ctx_sysv_create_context() { + int *b = (int *)smx_ctx_base_factory_create_context_sized(); + getcontext(); + memcpy(a, &b, sizeof(int)); + switch (a[0]) + ; +} + diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index f231ebe..669d0b1 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -3221,8 +3221,11 @@ visit_reference_op_load (tree lhs, tree op, gimple *stmt) gimple_seq stmts = NULL; result = maybe_push_res_to_seq (rcode, TREE_TYPE (op), ops, &stmts); - gcc_assert (result && gimple_seq_singleton_p (stmts)); - new_stmt = gimple_seq_first_stmt (stmts); + if (result) + { + gcc_assert (gimple_seq_singleton_p (stmts)); + new_stmt = gimple_seq_first_stmt (stmts); + } } else /* The expression is already available. */ |