From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B950D3858413; Tue, 31 Jan 2023 01:29:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B950D3858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675128563; bh=iZV8iwB/TmaS/x+D4IOy6sR+wU2grGJNTXDvS9KinzM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oWS3pFtwWVXVSxitdNz3xtTcs0uoJL6iQYmgRxhNWMa7lLrkPQBSf+efaO8kigEBg QHVHBYE680qQm3Ox7eQvfuxOcrzUeYU8vLN8KKn1jIC8A3jmoEWQQuCJEuoo6+z7y1 WbkcV8szK+Htr3wSvEN1SiB2xrJ35d0MNly5SYSk= From: "luangruo at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/65673] [10/11/12/13 Regression] Compound literal with initializer for zero-sized array drops other initializers Date: Tue, 31 Jan 2023 01:29:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: luangruo at yahoo dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65673 Po Lu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |luangruo at yahoo dot com --- Comment #9 from Po Lu --- This bug still exists, both in GCC 12.2 and trunk: struct sfnt_generic_test_args { unsigned int *expected_stack; int expected_stack_elements; int expected_trap : 1; int expected_IP; }; struct sfnt_generic_test_args stack_underflow_test_args =3D { (unsigned int [0]) { }, 0, 1, 4, }; on: Using built-in specs. COLLECT_GCC=3D/usr/bin/gcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-redhat-linux/12/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=3Dc,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=3D/usr --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttp://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=3Dposix --enable-checking=3Drelease --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=3Dgnu --enable-plugin --enable-initfini-array --with-isl=3D/builddir/build/BUILD/gcc-12.2.1-20220819/obj-x86_64-redhat-li= nux/isl-install --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=3Dgeneric --with-arch_32=3Di686 --build=3Dx86_64-redhat-linux --with-build-config=3Dbootstrap-lto --enable-link-serialization=3D1 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.1 20220819 (Red Hat 12.2.1-2) (GCC)=20 and Using built-in specs. COLLECT_GCC=3D/opt/compiler-explorer/gcc-snapshot/bin/gcc Target: x86_64-linux-gnu Configured with: ../gcc-trunk-20230129/configure --prefix=3D/opt/compiler-explorer/gcc-build/staging --build=3Dx86_64-linux-= gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu --disable-bootstrap --enable-multiarch --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --enable-clocale=3Dgnu --enable-languages=3Dc,c++,fortran,ada,objc,obj-c++,go,d,rust --enable-ld= =3Dyes --enable-gold=3Dyes --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-linker-build-id --enable-lto --enable-plugins --enable-threads=3Dp= osix --with-pkgversion=3DCompiler-Explorer-Build-gcc-ee2c965ee205ae12bc78d864133= 7380df3b1d3f3-binutils-2.38 Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.1 20230129 (experimental) (Compiler-Explorer-Build-gcc-ee2c965ee205ae12bc78d8641337380df3b1d3f3-binut= ils-2.38)=20 COLLECT_GCC_OPTIONS=3D'-fdiagnostics-color=3Dalways' '-g' '-o' '/app/output= .s' '-S' '-v' '-mtune=3Dgeneric' '-march=3Dx86-64' '-dumpdir' '/app/' /opt/compiler-explorer/gcc-trunk-20230129/bin/../libexec/gcc/x86_64-linux-g= nu/13.0.1/cc1 -quiet -v -imultiarch x86_64-linux-gnu -iprefix /opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-gnu/1= 3.0.1/ -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c -mtune=3Dgeneric -march=3Dx86-64 -g -version -fdiagnostics-color=3Dalways -o /app/output.s GNU C17 (Compiler-Explorer-Build-gcc-ee2c965ee205ae12bc78d8641337380df3b1d3f3-binut= ils-2.38) version 13.0.1 20230129 (experimental) (x86_64-linux-gnu) compiled by GNU C version 9.4.0, GMP version 6.2.1, MPFR version 4.= 1.0, MPC version 1.2.1, isl version isl-0.24-GMP GGC heuristics: --param ggc-min-expand=3D30 --param ggc-min-heapsize=3D4096 ignoring nonexistent directory "/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-gnu/= 13.0.1/../../../../x86_64-linux-gnu/include" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/../../lib/gcc/x86= _64-linux-gnu/13.0.1/include" ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/../../lib/gcc/x86= _64-linux-gnu/13.0.1/include-fixed/x86_64-linux-gnu" ignoring duplicate directory "/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/../../lib/gcc/x86= _64-linux-gnu/13.0.1/include-fixed" ignoring nonexistent directory "/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/../../lib/gcc/x86= _64-linux-gnu/13.0.1/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-gnu/1= 3.0.1/include /opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-gnu/1= 3.0.1/include-fixed/x86_64-linux-gnu /opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-gnu/1= 3.0.1/include-fixed /usr/local/include /opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/../../include /usr/include/x86_64-linux-gnu /usr/include End of search list. GNU C17 (Compiler-Explorer-Build-gcc-ee2c965ee205ae12bc78d8641337380df3b1d3f3-binut= ils-2.38) version 13.0.1 20230129 (experimental) (x86_64-linux-gnu) compiled by GNU C version 9.4.0, GMP version 6.2.1, MPFR version 4.= 1.0, MPC version 1.2.1, isl version isl-0.24-GMP GGC heuristics: --param ggc-min-expand=3D30 --param ggc-min-heapsize=3D4096 Compiler executable checksum: ad17c4694b07a4272f6162e91fa92744 COMPILER_PATH=3D/opt/compiler-explorer/gcc-trunk-20230129/bin/../libexec/gc= c/x86_64-linux-gnu/13.0.1/:/opt/compiler-explorer/gcc-trunk-20230129/bin/..= /libexec/gcc/x86_64-linux-gnu/:/opt/compiler-explorer/gcc-trunk-20230129/bi= n/../libexec/gcc/:/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/= x86_64-linux-gnu/13.0.1/../../../../x86_64-linux-gnu/bin/ LIBRARY_PATH=3D/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86= _64-linux-gnu/13.0.1/:/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/= gcc/x86_64-linux-gnu/:/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/= gcc/:/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-= gnu/13.0.1/../../../../lib64/:/lib/x86_64-linux-gnu/:/lib/../lib64/:/usr/li= b/x86_64-linux-gnu/:/usr/lib/../lib64/:/opt/compiler-explorer/gcc-trunk-202= 30129/bin/../lib/gcc/x86_64-linux-gnu/13.0.1/../../../../x86_64-linux-gnu/l= ib/:/opt/compiler-explorer/gcc-trunk-20230129/bin/../lib/gcc/x86_64-linux-g= nu/13.0.1/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS=3D'-fdiagnostics-color=3Dalways' '-g' '-o' '/app/output= .s' '-S' '-v' '-mtune=3Dgeneric' '-march=3Dx86-64' '-dumpdir' '/app/output.' Compiler returned: 0 results in the structure being generated as a .zero section of size 24, while it should really be: .quad
.long 0 .byte 1 .zero 3 .long 4 .zero 4 I hope it can be fixed, because this is causing real problems for Emacs. Thanks in advance.=