Re: dmd 2.057 release
On Saturday, 17 December 2011 at 11:02:41 UTC, bearophile wrote: Jonathan M Davis: On Friday, December 16, 2011 22:37:50 Christian Manning wrote: > ubyte[4] a; > auto x() { > return a; > } > void main() { > auto b = x()[1..$]; > } ... Regardless, the compiler shouldn't be ICEing though. Is it in Bugzilla? Bye, bearophile Looks to be the same issue as http://d.puremagic.com/issues/show_bug.cgi?id=4414
Re: dmd 2.057 release
On Friday, 16 December 2011 at 22:48:21 UTC, Jonathan M Davis wrote: That actually has exactly the same problem. You're slicing a temporary. You can't slice a static array unless it's an actual variable, or you're going to have problems. b points to a slice of a static array which doesn't exist anymore. It _might_ work depending on how the registers used and how the stack is laid out, but it's still a bad idea. Ah I get it now, thanks.
Re: dmd 2.057 release
On Friday, 16 December 2011 at 16:43:29 UTC, Jonathan M Davis wrote: On Friday, December 16, 2011 16:26:11 Christian Manning wrote: On Wednesday, 14 December 2011 at 07:05:25 UTC, Walter Bright wrote: > Highlights are use of XMM floating point registers in 64 bit > targets, and now supporting OS X 64 as a target. > > http://www.digitalmars.com/d/2.0/changelog.html > http://ftp.digitalmars.com/dmd.2.057.zip > > A lot of people put a ton of effort into making this D's best > release ever. Thanks! I found a bug when slicing static arrays. It's not new to 2.057 but I totally forgot about it (my bad) and didn't simplify a test case. auto x() { ubyte[4] a; return a; } auto y() { return x()[1..$]; } void main() { y(); } Gives: Internal error: ..\ztc\cgcs.c 354 Is this known or should I file a bug? It may bhttp://d.puremagic.com/issues/show_bug.cgi?id=4414 I'd point out though that that is really bad code, which should probably give an error when you try and compile it (though it obviously shouldn't cause the compiler to ICE regardless). http://d.puremagic.com/issues/show_bug.cgi?id=7087 - Jonathan M Davis It was just some mess around code, but I'll avoid it in the future, so thanks for pointing it out :) It does indeed look to be the same problem as http://d.puremagic.com/issues/show_bug.cgi?id=4414 I should also point out that the appearance of the error is dependant on the slice size. How about this as a better test case? ubyte[4] a; auto x() { return a; } void main() { auto b = x()[1..$]; }
Re: dmd 2.057 release
On Wednesday, 14 December 2011 at 07:05:25 UTC, Walter Bright wrote: Highlights are use of XMM floating point registers in 64 bit targets, and now supporting OS X 64 as a target. http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.057.zip A lot of people put a ton of effort into making this D's best release ever. Thanks! I found a bug when slicing static arrays. It's not new to 2.057 but I totally forgot about it (my bad) and didn't simplify a test case. auto x() { ubyte[4] a; return a; } auto y() { return x()[1..$]; } void main() { y(); } Gives: Internal error: ..\ztc\cgcs.c 354 Is this known or should I file a bug?