]> git.ipfire.org Git - thirdparty/gcc.git/commit
backport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading...
authorJakub Jelinek <jakub@redhat.com>
Fri, 22 Jun 2018 21:08:47 +0000 (23:08 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 22 Jun 2018 21:08:47 +0000 (23:08 +0200)
commitb8e47758b51d41c3f711501f5277214ddb492414
tree3500b3efb21b113ef237653d65e45ab8ba8290c0
parent7b42eb87dccf59fdb4ee63020caf3f41677a0763
backport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed vector member)

Backported from mainline
2018-04-07  Jakub Jelinek  <jakub@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.

From-SVN: r261951
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