re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed...
authorJakub Jelinek <jakub@redhat.com>
Sat, 7 Apr 2018 07:20:42 +0000 (09:20 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 7 Apr 2018 07:20:42 +0000 (09:20 +0200)
commiteda71a9eeaaf1ea16ba56d8cc5a4eb194f6025f7
treeb1acf024b403009d0a3344de142b9f251ad1c416
parentf1a0afe2aa1447c2d7962f52e8e278c40ba5fe19
re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed vector member)

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.

From-SVN: r259206
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr85257.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c