public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [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
@ 2022-01-21 17:46 wz at email dot sdu.edu.cn
  2022-01-21 17:48 ` [Bug c++/104168] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: wz at email dot sdu.edu.cn @ 2022-01-21 17:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104168

            Bug ID: 104168
           Summary: Crashed when compile `void f(const int N){ int a[1][N]
                    = {}; }`, 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=52258&action=edit
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] = {};     // internal compiler error
//int a[1][N]{};        // same error
//int a[1][N];          // ok
//int a[1][N] = {{}};   // ok
}

# g++ -v -save-temps demo.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-7ubuntu2'
--with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-gcn/usr
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-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=generic -march=x86-64
-fpch-preprocess -fasynchronous-unwind-tables -fstack-protector-strong -Wformat
-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-fixed"
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='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-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=generic -march=x86-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=100 --param ggc-min-heapsize=131072
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=100 --param ggc-min-heapsize=131072
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] = {}; }
      |                          ^
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_modifier,
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 <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/104168] Crashed when compile `void f(const int N){ int a[1][N] = {}; }`, internal compiler error: in make_decl_rtl, at varasm.c:1422
  2022-01-21 17:46 [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 wz at email dot sdu.edu.cn
@ 2022-01-21 17:48 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-21 17:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104168

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 58646.

*** This bug has been marked as a duplicate of bug 58646 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-21 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 17:46 [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 wz at email dot sdu.edu.cn
2022-01-21 17:48 ` [Bug c++/104168] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).