summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-30 23:34:28 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-30 23:34:28 +0000
commit0d051eceb3f8b8295a7679ac8c69067da4428b31 (patch)
treeef224dc8658616e2502002396260db31312b7fa6 /gcc/tree-ssa-ccp.c
parent5ddbd3d71c9376bb8d76abcf5aad8156bfeb2f80 (diff)
downloadgcc-0d051eceb3f8b8295a7679ac8c69067da4428b31.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142972 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index d68337fc402..d0fcf3937a7 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -860,6 +860,10 @@ may_propagate_address_into_dereference (tree addr, tree deref)
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. */