https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85257
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Sat Apr 7 07:20:42 2018 New Revision: 259206 URL: https://gcc.gnu.org/viewcvs?rev=259206&root=gcc&view=rev Log: 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 (offseti - 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: trunk/gcc/testsuite/gcc.dg/pr85257.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-sccvn.c