+2018-05-22 Martin Liska <mliska@suse.cz>
+
+ PR ipa/85607
+ * ipa-icf.c (sem_item::add_type): Do not ICE for incomplete types.
+
2018-05-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/85863
}
else if (RECORD_OR_UNION_TYPE_P (type))
{
- gcc_checking_assert (COMPLETE_TYPE_P (type));
+ /* Incomplete types must be skipped here. */
+ if (!COMPLETE_TYPE_P (type))
+ {
+ hstate.add_int (RECORD_TYPE);
+ return;
+ }
+
hashval_t *val = optimizer->m_type_hash_cache.get (type);
if (!val)
hashval_t hash;
hstate2.add_int (RECORD_TYPE);
- gcc_assert (COMPLETE_TYPE_P (type));
-
for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f))
if (TREE_CODE (f) == FIELD_DECL)
{
+2018-05-22 Martin Liska <mliska@suse.cz>
+
+ PR ipa/85607
+ * g++.dg/ipa/pr85607.C: New test.
+
2018-05-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/85863
--- /dev/null
+// { dg-do compile }
+/* { dg-options "-O2" } */
+
+class A; // { dg-message "forward declaration of 'class A'" }
+
+A *a; // { dg-warning "'a' has incomplete type" }
+
+int
+main (int argc, char **argv)
+{
+ delete a; // { dg-warning "delete" "warn" }
+ // { dg-message "note" "note" { target *-*-* } .-1 }
+ return 0;
+}