PR middle-end/38505
* tree-ssa-ccp.c (may_propagate_address_into_dereference): Return
false if ADDR's operand has incomplete type.
Revert:
2008-12-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/38505
* tree-ssa.c (useless_type_conversion_p_1): Return
false if inner_type is incomplete and outer_type is complete.
From-SVN: r142972
+2008-12-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38505
+ * tree-ssa-ccp.c (may_propagate_address_into_dereference): Return
+ false if ADDR's operand has incomplete type.
+
+ Revert:
+ 2008-12-15 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/38505
+ * tree-ssa.c (useless_type_conversion_p_1): Return
+ false if inner_type is incomplete and outer_type is complete.
+
2008-12-31 Jakub Jelinek <jakub@redhat.com>
PR middle-end/38676
gcc_assert (INDIRECT_REF_P (deref)
&& TREE_CODE (addr) == ADDR_EXPR);
+ /* Don't propagate if ADDR's operand has incomplete type. */
+ if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_OPERAND (addr, 0))))
+ return false;
+
/* If the address is invariant then we do not need to preserve restrict
qualifications. But we do need to preserve volatile qualifiers until
we can annotate the folded dereference itself properly. */
if (TREE_CODE (inner_type) != TREE_CODE (outer_type))
return false;
- /* Conversion from an incomplete to a complete type is never
- useless. */
- if (!COMPLETE_TYPE_P (inner_type) && COMPLETE_TYPE_P (outer_type))
- return false;
-
/* ??? This seems to be necessary even for aggregates that don't
have TYPE_STRUCTURAL_EQUALITY_P set. */