]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: fix wrong encoding for zero-sized arrays [PR125618] master trunk
authorMartin Uecker <uecker@tugraz.at>
Sat, 6 Jun 2026 13:08:19 +0000 (15:08 +0200)
committerMartin Uecker <uecker@gcc.gnu.org>
Sat, 6 Jun 2026 21:56:52 +0000 (23:56 +0200)
commit68d3f1e2c20efe07f99de3720d1732c4b987ff22
treeb6836e142792483cf63611c9f74106b709f542d9
parent2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7
c: fix wrong encoding for zero-sized arrays [PR125618]

This reverts one change from 106970adca69c9c577e6c75f4e69a08cd9ea2df0
that replaced build_range_type with build_index_type.  In the function
complete_array_type this breaks zero-sized arrays created from an empty
initializer which there are represented using the C++ FE way [0, -1]
causing issues on 32 bit architectures.

After this partial revert this representation remains inconsistent to
the usual C FE representation [0, NULL_TREE] (as before by change).

PR c/125618

gcc/c-family/ChangeLog:
* c-common.cc (complete_array_type): Change back to using
build_range_type.
gcc/c-family/c-common.cc