On 6/3/2026 1:18 PM, Martin Uecker wrote:
This is causing warning regressions on a variety of ports, including but not limited to fr30-elf, m32r-elf, bfin-elf visium-elf, sh3-linux-gnu c6x-elf cris-elf, etc etc.Bootstrapped and regression tested on x86_64. c: harmonize handling of arraysThis code harmonizes the handling of arrays in C by consistentlyusing build_index_type instead of build_range_type when creating arrays and using top_array_vla_pp to detect top-level VLAs.gcc/c-family/ChangeLog:* c-common.cc (complete_array_type): Use build_index_type. * c-ubsan.cc (ubsan_instrument_bounds_pointer_address): Likewise.gcc/c/ChangeLog:* c-decl.cc (grokdeclarator): Likewise. * c-typeck.cc (c_verify_type,c_build_array_type, c_expr_countof_expr,comptypes_internal): Use top_array_vla_p. (top_array_vla_p): Rename to use _p convention and simplify.
Tests that now fail, but worked before (14 tests): fr30-sim: gcc: gcc.dg/Warray-bounds-52.c (test for warnings, line 19) fr30-sim: gcc: gcc.dg/Warray-bounds-52.c (test for warnings, line 20) fr30-sim: gcc: gcc.dg/Warray-bounds-52.c (test for warnings, line 21) fr30-sim: gcc: gcc.dg/Warray-bounds-52.c (test for warnings, line 34) fr30-sim: gcc: gcc.dg/Warray-bounds-52.c (test for warnings, line 35) fr30-sim: gcc: gcc.dg/Warray-bounds-52.c (test for excess errors) fr30-sim: gcc: gcc.dg/Warray-bounds-53.c (test for warnings, line 19) fr30-sim: gcc: gcc.dg/Warray-bounds-53.c (test for warnings, line 20) fr30-sim: gcc: gcc.dg/Warray-bounds-53.c (test for warnings, line 21) fr30-sim: gcc: gcc.dg/Warray-bounds-53.c (test for warnings, line 34) fr30-sim: gcc: gcc.dg/Warray-bounds-53.c (test for warnings, line 35) fr30-sim: gcc: gcc.dg/Warray-bounds-53.c (test for excess errors)
Jeff
