On Monday, 4 November 2013 at 22:09:45 UTC, jerro wrote:
void main() {
auto s = CFS(1.0); // crash
//auto s = CFS(1, Y()); // crash
//auto s = CFS(1, Y([])); // works
writeln(s);
}
What do you mean by crash ?
It's segfaults. It doesn't happen if you change 1.0 literal to
some other
On Tuesday, 5 November 2013 at 09:34:47 UTC, John Colvin wrote:
On Monday, 4 November 2013 at 22:09:45 UTC, jerro wrote:
void main() {
auto s = CFS(1.0); // crash
//auto s = CFS(1, Y()); // crash
//auto s = CFS(1, Y([])); // works
writeln(s);
}
What do you mean by crash ?
It's
On Tuesday, 5 November 2013 at 09:34:47 UTC, John Colvin wrote:
Can't reproduce on Git master x86_64 linux. Prints 0 no matter
what flags are used.
Mac - OS X 10.9 (13A603)
dmd -v
DMD64 D Compiler v2.064
Copyright (c) 1999-2013 by Digital Mars written by Walter Bright
bash-3.2$ rdmd
On Tuesday, 5 November 2013 at 00:16:11 UTC, deadalnix wrote:
I'm not sure what DMD is trying to do, but the function call to
writefln is clearly wrong.
Strange bug.
FWIW adding a constructor `this(immutable(int)[] data) { _data =
data; }` seems to be a workaround.
Thanks
Dan
On Tuesday, 5 November 2013 at 00:16:11 UTC, deadalnix wrote:
I'm not sure what DMD is trying to do, but the function call to
writefln is clearly wrong.
Strange bug.
FWIW adding a constructor `this(immutable(int)[] data) { _data =
data; }` seems to be a workaround.
Thanks
Dan
Ok - pretty sure this is not related to 16-byte structs, since if
I just remove one of the fields it still crashes. I opened an
issue - and here is a simplified version:
http://d.puremagic.com/issues/show_bug.cgi?id=11440
import std.stdio;
struct Y {
private immutable(int)[] _data;
}
On Monday, 4 November 2013 at 19:24:11 UTC, Daniel Davidson wrote:
Ok - pretty sure this is not related to 16-byte structs, since
if I just remove one of the fields it still crashes. I opened
an issue - and here is a simplified version:
http://d.puremagic.com/issues/show_bug.cgi?id=11440
void main() {
auto s = CFS(1.0); // crash
//auto s = CFS(1, Y()); // crash
//auto s = CFS(1, Y([])); // works
writeln(s);
}
What do you mean by crash ?
It's segfaults. It doesn't happen if you change 1.0 literal to
some other value,
say 2.0. It's a truly bizarre bug.
Here's a
It doesn't happen with -O, or when compiled with LDC or GDC.
And it doesn't happen when building with -m32 (I'm on x86_64
linux).
OK.
Now usual question to try to understand what is going wrong.
Can you try on 32/64 bits ? Also, what happen with GDC and LDC ?
On Monday, 4 November 2013 at 22:27:39 UTC, deadalnix wrote:
OK.
Now usual question to try to understand what is going wrong.
Can you try on 32/64 bits ? Also, what happen with GDC and LDC ?
The code I posted above prints 3ff0 when built with
dmd on x86_64 without any flags. It
On Monday, 4 November 2013 at 22:42:35 UTC, jerro wrote:
On Monday, 4 November 2013 at 22:27:39 UTC, deadalnix wrote:
OK.
Now usual question to try to understand what is going wrong.
Can you try on 32/64 bits ? Also, what happen with GDC and LDC
?
The code I posted above prints
Then it look like a dmd backend bug. Can you post the generated
assembly ?
0043050c _Dmain:
43050c: push %rbp
43050d: mov%rsp,%rbp
430510: sub$0x40,%rsp
430514: movabs $0x3ff0,%rax
43051b:
43051e: mov
On Monday, 4 November 2013 at 22:56:48 UTC, jerro wrote:
Then it look like a dmd backend bug. Can you post the
generated assembly ?
0043050c _Dmain:
43050c: push %rbp
43050d: mov%rsp,%rbp
430510: sub$0x40,%rsp
430514: movabs
On Monday, 4 November 2013 at 23:07:27 UTC, deadalnix wrote:
On Monday, 4 November 2013 at 22:56:48 UTC, jerro wrote:
Then it look like a dmd backend bug. Can you post the
generated assembly ?
0043050c _Dmain:
43050c: push %rbp
43050d: mov%rsp,%rbp
430510:
On Monday, 4 November 2013 at 23:14:08 UTC, jerro wrote:
On Monday, 4 November 2013 at 23:07:27 UTC, deadalnix wrote:
On Monday, 4 November 2013 at 22:56:48 UTC, jerro wrote:
Then it look like a dmd backend bug. Can you post the
generated assembly ?
0043050c _Dmain:
43050c:
and what is the 16 byte struct bug?
http://forum.dlang.org/post/nqqujtblyvxvtrlsb...@forum.dlang.org
import std.datetime;
import std.range;
import std.stdio;
struct DateRate {
Date date;
double value = 0.0;
}
struct RateCurve {
private immutable(DateRate)[] _data;
}
struct CFS {
17 matches
Mail list logo