tree-optimization/98282 - classify V_C_E<constant> as nary
authorRichard Biener <rguenther@suse.de>
Mon, 4 Jan 2021 10:40:40 +0000 (11:40 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 4 Jan 2021 11:59:44 +0000 (12:59 +0100)
commit13b80a7d1b9b712651f5ece589634a6e57c26362
tree0067893ed4d2a3e27465eabdb9ac70055c8aebff
parentb41e6dd50f329b0291457e939d4c0dacd81c82c1
tree-optimization/98282 - classify V_C_E<constant> as nary

This avoids running into memory reference code in compute_avail by
properly classifying unfolded reference trees on constants.

2021-01-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98282
* tree-ssa-sccvn.c (vn_get_stmt_kind): Classify tcc_reference on
invariants as VN_NARY.

* g++.dg/opt/pr98282.C: New testcase.
gcc/testsuite/g++.dg/opt/pr98282.C [new file with mode: 0644]
gcc/tree-ssa-sccvn.c