re PR target/63679 ([AArch64] Failure to constant fold.)
authorRichard Biener <rguenther@suse.de>
Mon, 24 Nov 2014 14:07:18 +0000 (14:07 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 24 Nov 2014 14:07:18 +0000 (14:07 +0000)
commit8403c2cf5f66758fc78a01a675b0d218fded0202
tree67f5be1ec46132969be310c870c5591ebbadbab2
parent34a4625c52673828ff9b1eac7f68b5d23b58c5f5
re PR target/63679 ([AArch64] Failure to constant fold.)

2014-11-24  Richard Biener  <rguenther@suse.de>

PR tree-optimization/63679
* tree-ssa-sccvn.c: Include ipa-ref.h, plugin-api.h and cgraph.h.
(copy_reference_ops_from_ref): Fix non-constant ADDR_EXPR case
to properly leave off at -1.
(fully_constant_vn_reference_p): Generalize folding from
constant initializers.
(vn_reference_lookup_3): When looking through aggregate copies
handle offsetted reads and try simplifying the result to
a constant.
* gimple-fold.h (fold_ctor_reference): Export.
* gimple-fold.c (fold_ctor_reference): Likewise.

* gcc.dg/tree-ssa/ssa-fre-42.c: New testcase.
* gcc.dg/tree-ssa/20030807-5.c: Avoid folding read from global to zero.
* gcc.target/i386/ssetype-1.c: Likewise.
* gcc.target/i386/ssetype-3.c: Likewise.
* gcc.target/i386/ssetype-5.c: Likewise.

From-SVN: r218019
gcc/ChangeLog
gcc/gimple-fold.c
gcc/gimple-fold.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-42.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/ssetype-1.c
gcc/testsuite/gcc.target/i386/ssetype-3.c
gcc/testsuite/gcc.target/i386/ssetype-5.c
gcc/tree-ssa-sccvn.c