aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-08-28 16:57:03 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2021-08-29 17:19:02 +0200
commit07984707be4eb9aea55dafbbc796790b8b8ac700 (patch)
tree16edae4dbde24c37964fd7b4cabcef202f832cf0 /gcc/testsuite/gdc.dg
parentdc033e0149fd7790b89f816041e87a6ddc22e21c (diff)
downloadgcc-07984707be4eb9aea55dafbbc796790b8b8ac700.zip
gcc-07984707be4eb9aea55dafbbc796790b8b8ac700.tar.gz
gcc-07984707be4eb9aea55dafbbc796790b8b8ac700.tar.bz2
d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094)
User defined types have the TYPE_CXX_ODR_P flag set, but closure frames did not. This mismatch led to an ICE in the conflict detection for ODR and interoperable non-ODR types. As a given closure frame is tied explicitly to a function, it already conforms to ODR. PR d/102094 gcc/d/ChangeLog: * d-codegen.cc (build_frame_type): Set TYPE_CXX_ODR_P. gcc/testsuite/ChangeLog: * gdc.dg/lto/pr102094_0.d: New test.
Diffstat (limited to 'gcc/testsuite/gdc.dg')
-rw-r--r--gcc/testsuite/gdc.dg/lto/pr102094_0.d18
1 files changed, 18 insertions, 0 deletions
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 0000000..f83631a
--- /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);
+ }
+}