Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 15 - internal compiler error: in expand_expr_real_1, at expr.c:9266
Summary: internal compiler error: in expand_expr_real_1, at expr.c:9266
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: 4.8.x
Hardware: x86_64 Linux
: --- normal
Assignee: Iain Buclaw
URL:
: 20 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-17 12:32 CEST by deadalnix
Modified: 2012-10-27 00:55 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description deadalnix 2012-10-17 12:32:59 CEST
Code below trigger an ICE.

It is likely that dmd suffer from the same bug but don't detect it in the backend.

import std.algorithm;
class A {

}

class B {
	A a;
}

class C {
	
	void visit(B b) {
		auto as = [b.a];
		as.map!(d => d);
	}
}

gdc output :

/opt/gdc/include/d/4.8.0/std/algorithm.d: In member function 'bug.C.visit.map!(__lambda2).map!(A[]).map':
/opt/gdc/include/d/4.8.0/std/algorithm.d:380: internal compiler error: in expand_expr_real_1, at expr.c:9266
0x71c376 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**)
	../../gcc-4.8-20121007/gcc/expr.c:9261
0x723471 store_expr(tree_node*, rtx_def*, int, bool)
	../../gcc-4.8-20121007/gcc/expr.c:5180
0x72807e expand_assignment(tree_node*, tree_node*, bool)
	../../gcc-4.8-20121007/gcc/expr.c:4826
0x67d76f expand_gimple_stmt_1
	../../gcc-4.8-20121007/gcc/cfgexpand.c:2106
0x67d76f expand_gimple_stmt
	../../gcc-4.8-20121007/gcc/cfgexpand.c:2202
0x67eb84 expand_gimple_basic_block
	../../gcc-4.8-20121007/gcc/cfgexpand.c:3965
0x6807a3 gimple_expand_cfg
	../../gcc-4.8-20121007/gcc/cfgexpand.c:4484
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gdcproject.org/bugzilla> for instructions.
Comment 1 Iain Buclaw 2012-10-17 15:19:37 CEST
It's entirely possible that it's a problem in the gcc backend.  I've tested on a copy from 08/07/2012 and can't reproduce.

Regards
Iain
Comment 2 Iain Buclaw 2012-10-17 15:31:50 CEST
.
Comment 3 Iain Buclaw 2012-10-22 19:20:00 CEST
On further analysis looks to be a custom static chain bug...

In the map!() template, we emit this code:

{
  struct MapResult __ctmp997 = {};
  __ctmp.this = this;     // 'this' is in another context that we can't access for here.

  return <retval> = *__ctor (&__ctmp997, r);
}


Maybe will see if DMD does the same...
Comment 5 Iain Buclaw 2012-10-26 12:20:35 CEST
*** Bug 20 has been marked as a duplicate of this bug. ***
Comment 6 deadalnix 2012-10-26 18:23:52 CEST
(In reply to comment #4)
> https://github.com/D-Programming-GDC/GDC/commit/20c0b776702947a338afc953ba35234425994c65

So this is finally not related to dmd ?
Comment 7 Iain Buclaw 2012-10-27 00:55:49 CEST
(In reply to comment #6)
> (In reply to comment #4)
> > https://github.com/D-Programming-GDC/GDC/commit/20c0b776702947a338afc953ba35234425994c65
> 
> So this is finally not related to dmd ?

Never said it was related to dfe. :)