Skip to content
Snippets Groups Projects
Commit e206feca authored by Iain Buclaw's avatar Iain Buclaw
Browse files

d: Fix internal compiler error: Segmentation fault at gimple-expr.cc:88

Because complex types are deprecated in the language, the new way to
expose native complex types is by defining an enum with a basetype of a
library-defined struct that is implicitly treated as-if it is native.
As casts are not implicitly added by the front-end when downcasting from
enum to its underlying type, we must insert an explicit cast during the
code generation pass.

	PR d/106623

gcc/d/ChangeLog:

	* d-codegen.cc (underlying_complex_expr): New function.
	(d_build_call): Handle passing native complex objects as the
	library-defined equivalent.
	* d-tree.h (underlying_complex_expr): Declare.
	* expr.cc (ExprVisitor::visit (DotVarExp *)): Call
	underlying_complex_expr instead of build_vconvert.

gcc/testsuite/ChangeLog:

	* gdc.dg/torture/pr106623.d: New test.
parent 250b1fa1
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment