tree-optimization/113895 - consistency check fails in copy_reference_ops_from_ref
The following addresses consistency check fails in copy_reference_ops_from_ref when we are handling out-of-bound array accesses (it's almost impossible to identically mimic the get_ref_base_and_extent behavior). It also addresses the case where an out-of-bound constant offset computes to a -1 off which is the special value for "unknown". This patch basically turns off verification in those cases. PR tree-optimization/113895 * tree-ssa-sccvn.cc (copy_reference_ops_from_ref): Disable consistency checking when there are out-of-bound array accesses. Allow -1 off when from an array reference with constant index. * gcc.dg/torture/pr113895-2.c: New testcase. * gcc.dg/torture/pr113895-3.c: Likewise. * gcc.dg/torture/pr113895-4.c: Likewise.
Showing
- gcc/testsuite/gcc.dg/torture/pr113895-2.c 13 additions, 0 deletionsgcc/testsuite/gcc.dg/torture/pr113895-2.c
- gcc/testsuite/gcc.dg/torture/pr113895-3.c 10 additions, 0 deletionsgcc/testsuite/gcc.dg/torture/pr113895-3.c
- gcc/testsuite/gcc.dg/torture/pr113895-4.c 14 additions, 0 deletionsgcc/testsuite/gcc.dg/torture/pr113895-4.c
- gcc/tree-ssa-sccvn.cc 29 additions, 2 deletionsgcc/tree-ssa-sccvn.cc
Loading
Please register or sign in to comment