From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E37E33881D3E; Wed, 14 Dec 2022 11:52:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E37E33881D3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671018769; bh=KTN8gkvhC1IKqhmIARbDesEZkV4ook9zlc+Su5KfPYc=; h=From:To:Subject:Date:From; b=TkSMOxc+TqI8B00En6GLa+A4F+kkyjWFw9FyhVwP20AOtEJhc6p7c8WoiOZLiOD8B fAJ/ASrVCyUoRI3sqEblBiiz50MzAcHZjpOxIdCEL6wmP0pyfEHtlEWL6KLyiutfCV Vpx/ObSzSL5LIbh/3cnuxqYELk3Ot++sfL3wEHcw= From: "moritz.klammler at cetitec dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108099] New: ICE when parsing signed __int128_t typedef Date: Wed, 14 Dec 2022 11:52:49 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: moritz.klammler at cetitec 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 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=3D108099 Bug ID: 108099 Summary: ICE when parsing signed __int128_t typedef Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: moritz.klammler at cetitec dot com Target Milestone: --- There seems to be a problem in the parser regarding typedefs involving __int128_t prefixed with the signed keyword. $ cat test.ii using i128 =3D signed __int128_t; $ g++ -v -c test.ii Using built-in specs. COLLECT_GCC=3Dg++ Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=3Dc,c++,ada,fortran,go,lto,objc,obj-c++,d --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 12.2.0 (GCC)=20 COLLECT_GCC_OPTIONS=3D'-v' '-c' '-shared-libgcc' '-mtune=3Dgeneric' '-march= =3Dx86-64' /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/cc1plus -fpreprocessed test.ii -qu= iet -dumpbase test.ii -dumpbase-ext .ii -mtune=3Dgeneric -march=3Dx86-64 -versi= on -o /tmp/ccn4pU5h.s GNU C++17 (GCC) version 12.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version isl-0.25-GMP warning: MPFR header version 4.1.0-p13 differs from library version 4.1.1-p= 1. GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU C++17 (GCC) version 12.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version isl-0.25-GMP warning: MPFR header version 4.1.0-p13 differs from library version 4.1.1-p= 1. GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 402ce889a414e2a3abbbe3146fa0a6cb test.ii:1:21: internal compiler error: Segmentation fault 1 | using i128 =3D signed __int128_t; | ^~~~~~~~~~ 0x19eab38 internal_error(char const*, ...) ???:0 0x6f5f81 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ???:0 0x6fc532 groktypename(cp_decl_specifier_seq*, cp_declarator const*, bool) ???:0 0x7c7a9c c_parse_file() ???:0 0x8dcedd c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Interestingly, std::make_signed_t<__int128_t> is compiled fine. I have also tried a few variations in C and while a similar issue seems to exist, no segfault happened. $ cat test.i typedef unsigned __int128_t number; typedef signed __int128_t number; $ gcc -v -c test.i Using built-in specs. COLLECT_GCC=3Dgcc Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=3Dc,c++,ada,fortran,go,lto,objc,obj-c++,d --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 12.2.0 (GCC)=20 COLLECT_GCC_OPTIONS=3D'-v' '-c' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/cc1 -fpreprocessed test.i -quiet -dumpbase test.i -dumpbase-ext .i -mtune=3Dgeneric -march=3Dx86-64 -version= -o /tmp/ccdh1Nyr.s GNU C17 (GCC) version 12.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version isl-0.25-GMP warning: MPFR header version 4.1.0-p13 differs from library version 4.1.1-p= 1. GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU C17 (GCC) version 12.2.0 (x86_64-pc-linux-gnu) compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version isl-0.25-GMP warning: MPFR header version 4.1.0-p13 differs from library version 4.1.1-p= 1. GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 4b798a352742e8322eaa4a166b8f6299 test.i:1:29: error: expected =E2=80=98=3D=E2=80=99, =E2=80=98,=E2=80=99, = =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__attribute__=E2=80= =99 before =E2=80=98number=E2=80=99 1 | typedef unsigned __int128_t number; | ^~~~~~ test.i:2:29: error: expected =E2=80=98=3D=E2=80=99, =E2=80=98,=E2=80=99, = =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__attribute__=E2=80= =99 before =E2=80=98number=E2=80=99 2 | typedef signed __int128_t number; | ^~~~~~ I'm using GCC 12.2.0 as distributed with Archlinux on x86_64 GNU/Linux.=