https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85257
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Jun 25 17:45:48 2018 New Revision: 262094 URL: https://gcc.gnu.org/viewcvs?rev=262094&root=gcc&view=rev Log: Backported from mainline 2018-04-07 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/85257 * fold-const.c (native_encode_vector): If not all elts could fit and off is -1, return 0 rather than offset. * tree-ssa-sccvn.c (vn_reference_lookup_3): Pass (offset - offset2) / BITS_PER_UNIT as 4th argument to native_encode_expr. Verify len * BITS_PER_UNIT >= maxsizei. Don't adjust buffer in native_interpret_expr call. * gcc.dg/pr85257.c: New test. Added: branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr85257.c Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/fold-const.c branches/gcc-6-branch/gcc/testsuite/ChangeLog branches/gcc-6-branch/gcc/tree-ssa-sccvn.c