tree-optimization/97830 - fix compare of incomplete type size in VN
authorRichard Biener <rguenther@suse.de>
Mon, 16 Nov 2020 07:40:47 +0000 (08:40 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 16 Nov 2020 08:33:04 +0000 (09:33 +0100)
commitaaccdb9cec423ef4de9d541dbe0a95fa3346f430
tree585364478cd3954671d8105807738ce55bb913ae
parentc2099c1670f195d37fadee11bd097dd92bc60e46
tree-optimization/97830 - fix compare of incomplete type size in VN

This avoids passing NULL to expressions_equal_p.

2020-11-16  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97830
* tree-ssa-sccvn.c (vn_reference_eq): Check for incomplete
types before comparing TYPE_SIZE.

* gcc.dg/pr97830.c: New testcase.
gcc/testsuite/gcc.dg/pr97830.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c