http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15419

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-22 
20:44:50 UTC ---
For this case we're confused about srctype being void_type_node.  Eh.

Index: builtins.c
===================================================================
--- builtins.c    (revision 174027)
+++ builtins.c    (working copy)
@@ -8525,6 +8525,8 @@ fold_builtin_memory_op (location_t loc,
         dest = build1 (NOP_EXPR, TREE_TYPE (tem), dest);
     }
       srctype = TREE_TYPE (TREE_TYPE (src));
+      if (VOID_TYPE_P (srctype))
+    srctype = char_type_node;
       if (srctype
       && TREE_CODE (srctype) == ARRAY_TYPE
       && !tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len))
@@ -8534,6 +8536,8 @@ fold_builtin_memory_op (location_t loc,
       src = build1 (NOP_EXPR, build_pointer_type (srctype), src);
     }
       desttype = TREE_TYPE (TREE_TYPE (dest));
+      if (VOID_TYPE_P (srctype))
+    srctype = char_type_node;
       if (desttype
       && TREE_CODE (desttype) == ARRAY_TYPE
       && !tree_int_cst_equal (TYPE_SIZE_UNIT (desttype), len))

fixes it.

Reply via email to