This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/70852] ice in warn_for_memset


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))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]