From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 41FBC3858C60; Fri, 21 Jan 2022 17:46:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41FBC3858C60 From: "wz at email dot sdu.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104168] New: Crashed when compile `void f(const int N){ int a[1][N] = {}; }`, internal compiler error: in make_decl_rtl, at varasm.c:1422 Date: Fri, 21 Jan 2022 17:46:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wz at email dot sdu.edu.cn X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2022 17:46:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104168 Bug ID: 104168 Summary: Crashed when compile `void f(const int N){ int a[1][N] =3D {}; }`, internal compiler error: in make_decl_rtl, at varasm.c:1422 Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: wz at email dot sdu.edu.cn Target Milestone: --- Created attachment 52258 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D52258&action=3Dedit preprocessed source g++(11.2.0) crashed when compile such functions on ubuntu-21.10-x86_64: void f(const int N){ int a[1][N] =3D {}; // internal compiler error //int a[1][N]{}; // same error //int a[1][N]; // ok //int a[1][N] =3D {{}}; // ok } # g++ -v -save-temps demo.cpp Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 11.2.0-7ub= untu2' --with-bugurl=3Dfile:///usr/share/doc/gcc-11/README.Bugs --enable-languages=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix= =3D/usr --with-gcc-major-version-only --program-suffix=3D-11 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-bootstrap --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-= zlib --enable-libphobos-checking=3Drelease --with-target-system-zlib=3Dauto --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --enable-cet --with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --enable-offload-targets=3Dnvptx-none=3D/build/gcc-11-ZPT0kp/gcc-11-11.2.0/= debian/tmp-nvptx/usr,amdgcn-amdhsa=3D/build/gcc-11-ZPT0kp/gcc-11-11.2.0/deb= ian/tmp-gcn/usr --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu --with-build-config=3Dbootstrap-lto-lean --enable-link-serialization=3D2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2) COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-shared-libgcc' '-mtune=3Dgeneric' '-march=3Dx86-64' '-dumpdir' 'a-' /usr/lib/gcc/x86_64-linux-gnu/11/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE demo.cpp -mtune=3Dgeneric -march=3Dx86-64 -fpch-preprocess -fasynchronous-unwind-tables -fstack-protector-strong -Wfo= rmat -Wformat-security -fstack-clash-protection -fcf-protection -o a-demo.ii ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/11" ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/include-fi= xed" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/11 /usr/include/x86_64-linux-gnu/c++/11 /usr/include/c++/11/backward /usr/lib/gcc/x86_64-linux-gnu/11/include /usr/local/include /usr/include/x86_64-linux-gnu /usr/include End of search list. COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-shared-libgcc' '-mtune=3Dgeneric' '-march=3Dx86-64' '-dumpdir' 'a-' /usr/lib/gcc/x86_64-linux-gnu/11/cc1plus -fpreprocessed a-demo.ii -quiet -dumpdir a- -dumpbase demo.cpp -dumpbase-ext .cpp -mtune=3Dgeneric -march= =3Dx86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o a-demo.s GNU C++17 (Ubuntu 11.2.0-7ubuntu2) version 11.2.0 (x86_64-linux-gnu) compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.24-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU C++17 (Ubuntu 11.2.0-7ubuntu2) version 11.2.0 (x86_64-linux-gnu) compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.24-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: b2aa013a9bb78f98e29ce58cd37c6337 during RTL pass: expand demo.cpp: In function 'void f(int)': demo.cpp:1:26: internal compiler error: in make_decl_rtl, at varasm.c:1422 1 | void f(const int N){ int a[1][N] =3D {}; } | ^ 0x5f0d11 make_decl_rtl(tree_node*) ../../src/gcc/varasm.c:1422 0x11a73c5 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../src/gcc/expr.c:10248 0x15e0173 expand_constructor ../../src/gcc/expr.c:8380 0x11a6abd expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../src/gcc/expr.c:10540 0x120c2be expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modif= ier, rtx_def**, bool) ../../src/gcc/expr.c:8519 0x120c2be store_expr(tree_node*, rtx_def*, int, bool, bool) ../../src/gcc/expr.c:5886 0x133469d store_field ../../src/gcc/expr.c:7380 0x12061b7 expand_assignment(tree_node*, tree_node*, bool) ../../src/gcc/expr.c:5482 0x1204849 expand_gimple_stmt_1 ../../src/gcc/cfgexpand.c:3937 0x1204849 expand_gimple_stmt ../../src/gcc/cfgexpand.c:4035 0x11cb7b8 expand_gimple_basic_block ../../src/gcc/cfgexpand.c:6077 0x11cb7b8 execute ../../src/gcc/cfgexpand.c:6761 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=