]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/38505 (Revision 142061 caused ICE on __builtin_memcpy)
authorJakub Jelinek <jakub@redhat.com>
Tue, 30 Dec 2008 23:34:28 +0000 (00:34 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 30 Dec 2008 23:34:28 +0000 (00:34 +0100)
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

gcc/ChangeLog
gcc/tree-ssa-ccp.c
gcc/tree-ssa.c

index adff086bd0d058dca9af78c6ff949f1c83a2a226..ab6a187530cad60e094cc3e8c28008544435ecf1 100644 (file)
@@ -1,3 +1,15 @@
+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
index d68337fc402a2087b527031eef08c5407263d28d..d0fcf3937a73ea9f890159baa2a376162c8932dd 100644 (file)
@@ -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.  */
index ce0f1e4ee67b4fcfde8993f0fbbfdd358ba89577..935cad676c14a240844bcc0bb40bece2b4c8d12e 100644 (file)
@@ -1188,11 +1188,6 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
       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.  */