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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.0

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #3)
> So I think this ought to fix it:
> 
> --- a/gcc/tree-vrp.c
> +++ b/gcc/tree-vrp.c
> @@ -5051,7 +5051,8 @@ vrp_prop::check_mem_ref (location_t location, tree
> ref, bool ignore_off_by_one)
>       to identify the member where the reference originated.  */
>    tree reftype = TREE_TYPE (arg);
>    if (POINTER_TYPE_P (reftype)
> -      || RECORD_OR_UNION_TYPE_P (reftype))
> +      || RECORD_OR_UNION_TYPE_P (reftype)
> +      || VOID_TYPE_P (reftype))
>      return;
>  
>    offset_int eltsize;

Please use _positive_ tests!

  if (!(...))
    return;

so you clearly identify what you handle, not trying to enumerate the opposite.

Reply via email to