re PR c++/65851 (ice in set_lattice_value at tree-ssa-cc p.c:535)
authorRichard Biener <rguenther@suse.de>
Tue, 28 Apr 2015 07:26:41 +0000 (07:26 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 28 Apr 2015 07:26:41 +0000 (07:26 +0000)
commit85ebc1938f831130e98e8b0865cb172487254818
treeb1f8fc210896c895aad096222e3fc7480d565c31
parenta66dfffdb8946993ee06fe1ec9fdc3cbda5d96c6
re PR c++/65851 (ice in set_lattice_value at tree-ssa-cc p.c:535)

2015-04-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/65851
* tree-ssa-ccp.c (set_lattice_value): Perform a meet when
changing CONSTANT to CONSTANT non-copy.  Get new_val by reference.
(ccp_lattice_meet): Remove stray argument.  Use operand_equal_p
rather than simple_cst_equal as the latter doesn't handle COMPLEX_CST.
(ccp_visit_phi_node): Adjust.
(evaluate_stmt): For simplifications to SSA names return its
lattice value if that isn't VARYING.  Return immediately when
simplified to a constant.
(visit_assignment): Adjust.
(ccp_visit_stmt): Likewise.

* g++.dg/torture/pr65851.C: New testcase.

From-SVN: r222510
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr65851.C [new file with mode: 0644]
gcc/tree-ssa-ccp.c