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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
builtin_memref::offset_out_of_bounds has code to handle such anti-ranges, that
would avoid this warning, but it's only active when base has an array type, not
a compound type containing an array type.  Can't we just activate that code
more often?
--- a/gcc/gimple-ssa-warn-restrict.c
+++ b/gcc/gimple-ssa-warn-restrict.c
@@ -479,7 +479,7 @@ builtin_memref::offset_out_of_bounds (int strict,
offset_int ooboff[2]) const
   /* A temporary, possibly adjusted, copy of the offset range.  */
   offset_int offrng[2] = { offrange[0], offrange[1] };

-  if (DECL_P (base) && TREE_CODE (TREE_TYPE (base)) == ARRAY_TYPE)
+  if (true)
     {
       /* Check for offset in an anti-range with a negative lower bound.
         For such a range, consider only the non-negative subrange.  */

Reply via email to