From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4EAEC3858D38; Tue, 21 Nov 2023 21:46:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EAEC3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700603187; bh=cV7ypLnU9teGuH0UF4WhghrMFEX5SB0b05+t1xglCjE=; h=From:To:Subject:Date:From; b=rWSewpVp++LUaJWUxWENqrrmopWbRcd+dY1qJrXLC8VmhjOL4iWIC4JRed93BKGIa Ert3lDuh6/kIBio08BpjJ36LvmsIV+RFWpXLlMko0O9l+JTDaIL6563mIHuPef1yTW k5N2u/L8a3O74Oj/A2ySTeCH5sARolwOzCDps6Lg= From: "julia.desmazes at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112658] New: ICE: finish_expr_stmt , at cp/semantics.cc:892 Date: Tue, 21 Nov 2023 21:46:26 +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: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: julia.desmazes at gmail dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112658 Bug ID: 112658 Summary: ICE: finish_expr_stmt , at cp/semantics.cc:892 Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: julia.desmazes at gmail dot com Target Milestone: --- Created attachment 56664 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D56664&action=3Dedit preprocessed file ( ii ) Hello, I have come across an internal compiler error when using g++ 13.2.1. The error occurs when casting a temporary array into a pointer and forwardi= ng the result to a constructor. Code to reproduce :=20 ``` #include #include #include =20 #define DEFAULT_DST_MAC ((uint8_t[6]) { 0xFC, 0xFC, 0x48, 0, 0, 0}) class foo{ public: foo(const uint8_t new_mac[6]){ std::cout << new_mac << std::endl;=20=20=20=20=20=20 memcpy(&this->mac, new_mac, 6); } private: uint8_t mac[6]; }; int main(){ foo f((uint8_t*)DEFAULT_DST_MAC); return 0; } ``` Console log for `g++ -v -c main.cpp -freport-bug -save-temps` : ``` Using built-in specs. COLLECT_GCC=3Dg++ Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=3Dada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-boots= trap --prefix=3D/usr --libdir=3D/usr/lib --libexecdir=3D/usr/lib --mandir=3D/usr= /share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttps://bugs.archlinux.org/ --with-build-config=3Dbootstrap-lto --with-linker-hash-style=3Dgnu --with-system-zlib --enable-__cxa_atexit --enable-cet=3Dauto --enable-checking=3Drelease --enable-clocale=3Dgnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-obj= ect --enable-libstdcxx-backtrace --enable-link-serialization=3D1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=3Dposix --disable-libssp --disable-libstdc= xx-pch --disable-werror Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.1 20230801 (GCC) COLLECT_GCC_OPTIONS=3D'-v' '-c' '-freport-bug' '-save-temps' '-shared-libgc= c' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/cc1plus -E -quiet -v -D_GNU_SOURCE main.cpp -mtune=3Dgeneric -march=3Dx86-64 -freport-bug -fpch-preprocess -o = main.ii ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/in= clude" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1 /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/x86_= 64-pc-linux-gnu /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/back= ward /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include /usr/local/include /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS=3D'-v' '-c' '-freport-bug' '-save-temps' '-shared-libgc= c' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/cc1plus -fpreprocessed main.ii -qu= iet -dumpbase main.cpp -dumpbase-ext .cpp -mtune=3Dgeneric -march=3Dx86-64 -ver= sion -freport-bug -o main.s GNU C++17 (GCC) version 13.2.1 20230801 (x86_64-pc-linux-gnu) compiled by GNU C version 13.2.1 20230801, GMP version 6.3.0, MPFR version 4.2.0-p12, MPC version 1.3.1, isl version isl-0.26-GMP warning: MPFR header version 4.2.0-p12 differs from library version 4.2.1. GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 5a490a353c29b926850bca65a518c219 main.cpp: In function =E2=80=98int main()=E2=80=99: main.cpp:18:68: internal compiler error: in finish_expr_stmt, at cp/semantics.cc:892 18 | foo f((uint8_t*)DEFAULT_DST_MAC); | ^ 0x1ad33c8 internal_error(char const*, ...) ???:0 0x6b7b63 fancy_abort(char const*, int, char const*) ???:0 0x76527f cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ???:0 0x9443d0 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See for instructions. Preprocessed source stored into /tmp/ccJZigsM.out file, please attach this = to your bugreport. make: *** [makefile:10: main.o] Error 1 ``` If needed, the `ccJZigsM.out` file can be found in the following git : https://github.com/Essenceia/gcc_bug=20 I will be happy to provide any additional files if needed. Regards, Julia Desmazes=