https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70852

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot 
gnu.org
   Target Milestone|---                         |7.0

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The fix should be just:

--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -11796,6 +11796,7 @@ warn_for_memset (location_t loc, tree arg0, tree arg2,
      tree elt_type = TREE_TYPE (type);
      tree domain = TYPE_DOMAIN (type);
      if (!integer_onep (TYPE_SIZE_UNIT (elt_type))
+         && domain != NULL_TREE
          && TYPE_MAXVAL (domain)
          && TYPE_MINVAL (domain)
          && integer_zerop (TYPE_MINVAL (domain))

Reply via email to