Message ID | 20210829163126.2036025-1-ibuclaw@gdcproject.org |
---|---|
State | New |
Headers | show |
Series | [committed] d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094) | expand |
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc index fe2ad98e60a..ad20bd15403 100644 --- a/gcc/d/d-codegen.cc +++ b/gcc/d/d-codegen.cc @@ -2563,6 +2563,7 @@ build_frame_type (tree ffi, FuncDeclaration *fd) TYPE_FIELDS (frame_rec_type) = fields; TYPE_READONLY (frame_rec_type) = 1; + TYPE_CXX_ODR_P (frame_rec_type) = 1; layout_type (frame_rec_type); d_keep (frame_rec_type); diff --git a/gcc/testsuite/gdc.dg/lto/pr102094_0.d b/gcc/testsuite/gdc.dg/lto/pr102094_0.d new file mode 100644 index 00000000000..f83631a1158 --- /dev/null +++ b/gcc/testsuite/gdc.dg/lto/pr102094_0.d @@ -0,0 +1,18 @@ +// { dg-lto-do link } +module pr102094_0; + +extern(C) int printf(char* s, ...); + +struct S102094 +{ + int a; +} + +void main() +{ + S102094 x; + void nested() + { + printf(cast(char*)0, x); + } +}