https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108302
Bug ID: 108302
Summary: void fn (uint8_t auto... args); leads to internal
compiler error: Segmentation fault
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: lyubomir.filipov at amusnet dot com
Target Milestone: ---
Hi
Trying to compile the following code:
#include <cstdint>
void fn (uint8_t auto... args);
Leads to internal compiler error:
In file included from /usr/include/stdint.h:37,
from
/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stdint.h:9,
from /usr/include/c++/12.2.0/cstdint:41,
from source.cpp:1:
/usr/include/bits/stdint-uintn.h:24:19: internal compiler error: Segmentation
fault
24 | typedef __uint8_t uint8_t;
| ^~~~~~~
0x7f1cf4949fcf ???
/packages/base/glibc-2.36/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7f1cf49351c9 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f1cf4935284 __libc_start_main_impl
../csu/libc-start.c:381
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
Yes, I know that uint8_t auto is not supported by the C++ standard, but the
internal compiler error is a bit strange.
I am using Ubuntu 22.04 on 12th Gen Intel(R) Core(TM) i3-12100E
It happens with gcc 12.0, gcc 11.3. It also happens in compiler explorer with
the trunk version of gcc:
https://godbolt.org/z/41fxs18To
As it does happen with compiler explorer too, it looks like it is not related
to my OS or Hardware issue, as the gcc error log suggests.