diff options
author | Martin Sebor <msebor@redhat.com> | 2021-07-08 11:34:27 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-07-08 11:43:47 -0600 |
commit | 9bf9f27ac6db4823628c435da9b242fd82bf8d68 (patch) | |
tree | eb069a0bbba285e95cf3db4c4c11742f6fc26117 /gcc/gimple-array-bounds.cc | |
parent | 1ca642d785c49e9e0b28651b190720267703f023 (diff) | |
download | gcc-9bf9f27ac6db4823628c435da9b242fd82bf8d68.zip gcc-9bf9f27ac6db4823628c435da9b242fd82bf8d68.tar.gz gcc-9bf9f27ac6db4823628c435da9b242fd82bf8d68.tar.bz2 |
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.
Diffstat (limited to 'gcc/gimple-array-bounds.cc')
-rw-r--r-- | gcc/gimple-array-bounds.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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)) |