Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 121 - ICE when initializing immutable char to void
Summary: ICE when initializing immutable char to void
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: 4.8.x
Hardware: All All
: --- minor
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-04-19 06:18 CEST by Mike
Modified: 2014-06-14 13:34 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2014-04-19 06:18:10 CEST
The following code...

import std.stdio;

immutable char c = void; 

void main()
{
   writeln(c);
}

.. causes GDC to ICE:

internal compiler error: in gimplify_init_constructor, at gimplify.c:4269
0x7b3be3 gimplify_init_constructor
	../../gcc-4.8.2/gcc/gimplify.c:4269
0x7b445b gimplify_modify_expr_rhs
	../../gcc-4.8.2/gcc/gimplify.c:4468
0x7b47af gimplify_modify_expr
	../../gcc-4.8.2/gcc/gimplify.c:4861
0x7af1ab gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)
	../../gcc-4.8.2/gcc/gimplify.c:7193
0x7b0f86 gimplify_stmt(tree_node**, gimple_statement_d**)
	../../gcc-4.8.2/gcc/gimplify.c:5725
0x7b1d25 gimplify_and_add
	../../gcc-4.8.2/gcc/gimplify.c:370
0x7b1d25 internal_get_tmp_var
	../../gcc-4.8.2/gcc/gimplify.c:636
0x7ae668 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)
	../../gcc-4.8.2/gcc/gimplify.c:8023
0x7b329b gimplify_call_expr
	../../gcc-4.8.2/gcc/gimplify.c:2669
0x7aec6d gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)
	../../gcc-4.8.2/gcc/gimplify.c:7164
0x7b0f86 gimplify_stmt(tree_node**, gimple_statement_d**)
	../../gcc-4.8.2/gcc/gimplify.c:5725
0x7aedbb gimplify_statement_list
	../../gcc-4.8.2/gcc/gimplify.c:1561
0x7aedbb gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)
	../../gcc-4.8.2/gcc/gimplify.c:7582
0x7b0f86 gimplify_stmt(tree_node**, gimple_statement_d**)
	../../gcc-4.8.2/gcc/gimplify.c:5725
0x7b1652 gimplify_bind_expr
	../../gcc-4.8.2/gcc/gimplify.c:1253
0x7aec4a gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)
	../../gcc-4.8.2/gcc/gimplify.c:7364
0x7b0f86 gimplify_stmt(tree_node**, gimple_statement_d**)
	../../gcc-4.8.2/gcc/gimplify.c:5725
0x7aedbb gimplify_statement_list
	../../gcc-4.8.2/gcc/gimplify.c:1561
0x7aedbb gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**, bool (*)(tree_node*), int)
	../../gcc-4.8.2/gcc/gimplify.c:7582
0x7b0f86 gimplify_stmt(tree_node**, gimple_statement_d**)
	../../gcc-4.8.2/gcc/gimplify.c:5725


I was creating use cases to try and figure out what section the compiler puts variables in when I found this bug.  I don't know why anyone would want to do such a thing, but the compiler shouldn't crash.  DMD 2.065 handles it fine.
Comment 1 Iain Buclaw 2014-06-14 13:25:44 CEST
So how did we get a CONSTRUCTOR for a scalar type?

That is a good question...