public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108099] New: ICE when parsing signed __int128_t typedef
@ 2022-12-14 11:52 moritz.klammler at cetitec dot com
  2022-12-14 12:20 ` [Bug c++/108099] " redi at gcc dot gnu.org
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: moritz.klammler at cetitec dot com @ 2022-12-14 11:52 UTC (permalink / raw)
  To: gcc-bugs

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

            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 = signed __int128_t;

$ g++ -v -c test.ii
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/cc1plus -fpreprocessed test.ii -quiet
-dumpbase test.ii -dumpbase-ext .ii -mtune=generic -march=x86-64 -version -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-p1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
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-p1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 402ce889a414e2a3abbbe3146fa0a6cb
test.ii:1:21: internal compiler error: Segmentation fault
    1 | using i128 = 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 <https://bugs.archlinux.org/> 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=gcc
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/cc1 -fpreprocessed test.i -quiet
-dumpbase test.i -dumpbase-ext .i -mtune=generic -march=x86-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-p1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
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-p1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4b798a352742e8322eaa4a166b8f6299
test.i:1:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘number’
    1 | typedef unsigned __int128_t number;
      |                             ^~~~~~
test.i:2:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘number’
    2 | typedef   signed __int128_t number;
      |                             ^~~~~~

I'm using GCC 12.2.0 as distributed with Archlinux on x86_64 GNU/Linux.

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

end of thread, other threads:[~2023-12-19 21:50 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14 11:52 [Bug c++/108099] New: ICE when parsing signed __int128_t typedef moritz.klammler at cetitec dot com
2022-12-14 12:20 ` [Bug c++/108099] " redi at gcc dot gnu.org
2022-12-14 12:23 ` redi at gcc dot gnu.org
2022-12-14 12:26 ` redi at gcc dot gnu.org
2022-12-14 13:12 ` moritz.klammler at cetitec dot com
2022-12-14 17:46 ` [Bug c++/108099] ICE with type alias with `signed __int_128_t` pinskia at gcc dot gnu.org
2022-12-14 17:54 ` [Bug c++/108099] ICE with type alias with `signed __int128_t` pinskia at gcc dot gnu.org
2022-12-14 17:58 ` [Bug c++/108099] [12/13 Regression] " pinskia at gcc dot gnu.org
2022-12-14 18:18 ` jakub at gcc dot gnu.org
2022-12-14 19:05 ` jakub at gcc dot gnu.org
2022-12-14 19:20 ` jakub at gcc dot gnu.org
2022-12-21 12:37 ` rguenth at gcc dot gnu.org
2022-12-21 18:14 ` ville.voutilainen at gmail dot com
2023-01-31 16:00 ` pinskia at gcc dot gnu.org
2023-02-01  0:51 ` pinskia at gcc dot gnu.org
2023-02-01 11:59 ` redi at gcc dot gnu.org
2023-02-01 19:07 ` pinskia at gcc dot gnu.org
2023-02-01 19:17 ` jakub at gcc dot gnu.org
2023-03-09 22:25 ` jason at gcc dot gnu.org
2023-03-10  3:57 ` cvs-commit at gcc dot gnu.org
2023-03-10  3:59 ` [Bug c++/108099] [12 " jason at gcc dot gnu.org
2023-03-10 10:33 ` jakub at gcc dot gnu.org
2023-04-18 20:45 ` cvs-commit at gcc dot gnu.org
2023-04-19 15:23 ` cvs-commit at gcc dot gnu.org
2023-04-19 16:53 ` cvs-commit at gcc dot gnu.org
2023-04-19 16:59 ` [Bug c++/108099] [12/13/14 " jason at gcc dot gnu.org
2023-04-20  7:44 ` cvs-commit at gcc dot gnu.org
2023-04-20  7:48 ` cvs-commit at gcc dot gnu.org
2023-04-21 19:33 ` cvs-commit at gcc dot gnu.org
2023-05-02 20:25 ` [Bug c++/108099] [12/13 " cvs-commit at gcc dot gnu.org
2023-05-08 12:26 ` rguenth at gcc dot gnu.org
2023-07-25 10:50 ` [Bug c++/108099] [12 " redi at gcc dot gnu.org
2023-08-11 21:21 ` cvs-commit at gcc dot gnu.org
2023-12-19 21:50 ` jason 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).