https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105726
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The following fixes the bogus diagnostic:
diff --git a/gcc/gimple-ssa-warn-restrict.cc b/gcc/gimple-ssa-warn-restrict.cc
index b678e806da3..25c63f99c61 100644
--- a/gcc/gimple-ssa-warn-restrict.cc
+++ b/gcc/gimple-ssa-warn-restrict.cc
@@ -539,13 +559,6 @@ builtin_memref::set_base_and_offset (tree expr)
offset_int off = tree_to_shwi (memrefoff);
refoff += off;
}
-
- if (!integer_zerop (memrefoff))
- /* A non-zero offset into an array of struct with flexible array
- members implies that the array is empty because there is no
- way to initialize such a member when it belongs to an array.
- This must be some sort of a bug. */
- refsize = 0;
}
if (TREE_CODE (ref) == COMPONENT_REF)