https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111104
Bug ID: 111104
Summary: Fatal error: can't fill 256 bytes in section .rodata
Product: gcc
Version: 12.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: adavanian at nvidia dot com
Target Milestone: ---
Created attachment 55777
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55777&action=edit
The preprocessed file that triggers the bug
Compiling the following file results in a fatal error:
$gcc-12 -v
Using built-in specs.
COLLECT_GCC=gcc-12
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: "..."
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04)
$cat test.cpp
struct A {
int i;
constexpr A() : i(0) {}
};
struct B {
A a[1125488619006459660];
};
extern const B b{};
$gcc-12 test.cpp -o test.bin
/tmp/cc4H9Jsi.s: Assembler messages:
/tmp/cc4H9Jsi.s: Fatal error: can't fill 256 bytes in section .rodata of
/tmp/cc9wAeg1.o: 'file truncated'
/tmp/cc4H9Jsi.s: Fatal error: /tmp/cc9wAeg1.o: file truncated
Additional note: this test case is very similar to
testsuite\g++.dg\cpp0x\constexpr-array.C.