Thread overview | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 15, 2012 [Issue 7917] New: --inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7917 Summary: --inline option fails for complex expressions Product: D Version: unspecified Platform: x86_64 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: russel@winder.org.uk --- Comment #0 from Russel Winder <russel@winder.org.uk> 2012-04-15 08:45:43 PDT --- Ignoring all issues of whether the code is good code or even idiomatic code, I am getting compilation problem with using --inline on complex expressions. So, for example, http://www.russel.org.uk/Bazaar/Pi_Quadrature/pi_d2_parallelMapSequentialReduce.d works fine without --inline but with it fails with: pi_d2_parallelMapSequentialReduce.d(32): Error: function std.parallelism.TaskPool.amap!(partialSum).amap!(Result).amap cannot get frame pointer to execute However, perhaps more problematic is that http://www.russel.org.uk/Bazaar/Pi_Quadrature/pi_d2_sequentialMap.d http://www.russel.org.uk/Bazaar/Pi_Quadrature/pi_d2_sequentialMapParallelReduce.d work fine without the --inline option but fail with it giving the error: Internal error: toir.c 178 It is not clear whether this latter is at all related to the former. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 15, 2012 [Issue 7917] -inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #1 from bearophile_hugs@eml.cc 2012-04-15 15:19:26 PDT --- (In reply to comment #0) > However, perhaps more problematic is that > http://www.russel.org.uk/Bazaar/Pi_Quadrature/pi_d2_sequentialMap.d > http://www.russel.org.uk/Bazaar/Pi_Quadrature/pi_d2_sequentialMapParallelReduce.d > work fine without the --inline option but fail with it giving the error: > > Internal error: toir.c 178 I suggest you to minimize that program to the minimal program that shows the same error, and show it here. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 16, 2012 [Issue 7917] -inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 --- Comment #2 from Russel Winder <russel@winder.org.uk> 2012-04-16 04:41:09 PDT --- Given the code: import std.algorithm ; import std.range ; import std.stdio ; import std.typecons ; double partialSum ( immutable Tuple ! ( int , int , double ) data ) { return 1.0 ; } void execute ( immutable int numberOfTasks ) { immutable n = 1000000000 ; immutable delta = 1.0 / n ; immutable sliceSize = n / numberOfTasks ; immutable pi = reduce ! ( ( a , b ) => a + b ) ( 0.0 , map ! ( partialSum ) ( map ! ( i => tuple ( i , cast ( int ) sliceSize , cast ( double ) delta ) ) ( iota ( numberOfTasks ) ) ) ) ; } int main ( immutable string[] args ) { execute ( 1 ) ; return 0 ; } The problem lies with the cast of sliceSice. Change the parameter to a literal and it goes away. Change the definition of sliceSize and it goes away. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 16, 2012 [Issue 7917] -inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 --- Comment #3 from bearophile_hugs@eml.cc 2012-04-16 04:56:08 PDT --- (In reply to comment #2) > import std.algorithm ; > import std.range ; > import std.stdio ; > import std.typecons ; > > double partialSum ( immutable Tuple ! ( int , int , double ) data ) { > return 1.0 ; > } > > void execute ( immutable int numberOfTasks ) { > immutable n = 1000000000 ; > immutable delta = 1.0 / n ; > immutable sliceSize = n / numberOfTasks ; > immutable pi = reduce ! ( ( a , b ) => a + b ) ( 0.0 , map ! ( partialSum ) ( > map ! ( i => tuple ( i , cast ( int ) sliceSize , cast ( double ) delta ) ) > ( iota ( numberOfTasks ) ) ) ) ; > } > > int main ( immutable string[] args ) { > execute ( 1 ) ; > return 0 ; > } Maybe you are able to trim away some more stuff from that code, to minimize it some more. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 16, 2012 [Issue 7917] -inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 --- Comment #4 from Russel Winder <russel@winder.org.uk> 2012-04-16 05:08:36 PDT --- As far as I can see in the time available any further reduction loses the error message. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 17, 2012 [Issue 7917] -inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 --- Comment #5 from bearophile_hugs@eml.cc 2012-04-17 11:15:02 PDT --- (In reply to comment #4) > As far as I can see in the time available any further reduction loses the error message. A first reduction: import std.algorithm: map; import std.typecons: tuple, Tuple; int foo(Tuple!(int)) { return 1; } void main() { int x = 2; map!foo(map!(_ => tuple(x))([3])); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 17, 2012 [Issue 7917] -inline option fails for complex expressions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 --- Comment #6 from bearophile_hugs@eml.cc 2012-04-17 11:37:14 PDT --- I am hitting the same "Internal error: toir.c 178" even without -inline with this reduced code: import std.algorithm: sort; struct Foo(int m) { int x; } void bar(int m)(Foo!m[] foos) { void spam() { //sort!((Foo!m a, Foo!m b) => true)(foos); // no error sort!((a, b) => true)(foos); } } void main() { alias Foo!2 F2; bar([F2(1)]); alias Foo!3 F3; bar([F3(2)]); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 21, 2012 [Issue 7917] [ICE] (toir.c 178) with nested function | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 SomeDude <lovelydear@mailmetrash.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lovelydear@mailmetrash.com Platform|x86_64 |All OS/Version|Linux |All --- Comment #7 from SomeDude <lovelydear@mailmetrash.com> 2012-04-21 12:31:03 PDT --- Also happens on 2.059 Win32 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 03, 2012 [Issue 7917] [ICE] (toir.c 178) with nested function | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 Denis <verylonglogin.reg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |verylonglogin.reg@gmail.com --- Comment #8 from Denis <verylonglogin.reg@gmail.com> 2012-05-03 14:25:30 MSD --- This issue is derived from Issue 7955. Everything you need to create this issue from Issue 7955 is to wrap lambda template in a nested function. Code from Issue 7955 comment #1 with addition of `spam`: --- void f(alias fun)() { } void g(T)() { void spam() { f!(a => a)(); } } void main() { g!int(); g!long(); } --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 04, 2013 [Issue 7917] [ICE] (toir.c 178) with nested function | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | http://d.puremagic.com/issues/show_bug.cgi?id=7917 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |WORKSFORME --- Comment #9 from Walter Bright <bugzilla@digitalmars.com> 2013-10-03 18:06:03 PDT --- This compiles without error in 2.064 head. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation