Commit 03375368 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/38505 (Revision 142061 caused ICE on __builtin_memcpy)

	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
parent e8789588
2008-12-31 Jakub Jelinek <jakub@redhat.com> 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 PR middle-end/38676
* gimplify.c (gimple_regimplify_operands): For GIMPLE_SWITCH * gimplify.c (gimple_regimplify_operands): For GIMPLE_SWITCH
only regimplify switch index. only regimplify switch index.
...@@ -860,6 +860,10 @@ may_propagate_address_into_dereference (tree addr, tree deref) ...@@ -860,6 +860,10 @@ may_propagate_address_into_dereference (tree addr, tree deref)
gcc_assert (INDIRECT_REF_P (deref) gcc_assert (INDIRECT_REF_P (deref)
&& TREE_CODE (addr) == ADDR_EXPR); && 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 /* If the address is invariant then we do not need to preserve restrict
qualifications. But we do need to preserve volatile qualifiers until qualifications. But we do need to preserve volatile qualifiers until
we can annotate the folded dereference itself properly. */ we can annotate the folded dereference itself properly. */
......
...@@ -1188,11 +1188,6 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type) ...@@ -1188,11 +1188,6 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
if (TREE_CODE (inner_type) != TREE_CODE (outer_type)) if (TREE_CODE (inner_type) != TREE_CODE (outer_type))
return false; 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 /* ??? This seems to be necessary even for aggregates that don't
have TYPE_STRUCTURAL_EQUALITY_P set. */ have TYPE_STRUCTURAL_EQUALITY_P set. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment