From 9bf9f27ac6db4823628c435da9b242fd82bf8d68 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 8 Jul 2021 11:34:27 -0600 Subject: Use Object Size Type zero for -Warray-bounds [PR101374]. Resolves: PR bootstrap/101374 - -Warray-bounds accessing a member subobject as derived gcc/cp/ChangeLog: PR bootstrap/101374 * module.cc (module_state::read_macro_maps): Temporarily disable -Warray-bounds. (module_state::install_macros): Same. gcc/ChangeLog: PR bootstrap/101374 * gimple-array-bounds.cc (array_bounds_checker::check_mem_ref): Use Object Size Type 0 instead of 1. gcc/testsuite/ChangeLog: PR bootstrap/101374 * c-c++-common/Warray-bounds-3.c: Xfail assertion. * c-c++-common/Warray-bounds-4.c: Same. --- gcc/gimple-array-bounds.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/gimple-array-bounds.cc') diff --git a/gcc/gimple-array-bounds.cc b/gcc/gimple-array-bounds.cc index 83b8db9..8dfd6f9 100644 --- a/gcc/gimple-array-bounds.cc +++ b/gcc/gimple-array-bounds.cc @@ -427,7 +427,7 @@ array_bounds_checker::check_mem_ref (location_t location, tree ref, axssize = wi::to_offset (access_size); access_ref aref; - if (!compute_objsize (ref, 1, &aref, ranges)) + if (!compute_objsize (ref, 0, &aref, ranges)) return false; if (aref.offset_in_range (axssize)) -- cgit v1.1