]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gimple-ssa-warn-restrict.c
PR tree-optimization/86196 - Bogus -Wrestrict on memcpy between array elements at...
[thirdparty/gcc.git] / gcc / gimple-ssa-warn-restrict.c
index 035fbf88c116e2e681d46c59b900fe2d254aa6d9..d47f73f7be65bd603d62cc33f058213a9729a5a6 100644 (file)
@@ -272,15 +272,16 @@ builtin_memref::builtin_memref (tree expr, tree size)
 
   offset_int maxoff = maxobjsize;
   tree basetype = TREE_TYPE (base);
-  if (TREE_CODE (basetype) == ARRAY_TYPE
-      && ref
-      && array_at_struct_end_p (ref))
-    ;   /* Use the maximum possible offset for last member arrays.  */
-  else if (tree basesize = TYPE_SIZE_UNIT (basetype))
-    if (TREE_CODE (basesize) == INTEGER_CST)
-      /* Size could be non-constant for a variable-length type such
-        as a struct with a VLA member (a GCC extension).  */
-      maxoff = wi::to_offset (basesize);
+  if (TREE_CODE (basetype) == ARRAY_TYPE)
+    {
+      if (ref && array_at_struct_end_p (ref))
+       ;   /* Use the maximum possible offset for last member arrays.  */
+      else if (tree basesize = TYPE_SIZE_UNIT (basetype))
+       if (TREE_CODE (basesize) == INTEGER_CST)
+         /* Size could be non-constant for a variable-length type such
+            as a struct with a VLA member (a GCC extension).  */
+         maxoff = wi::to_offset (basesize);
+    }
 
   if (offrange[0] >= 0)
     {