Thread overview
long problems
Dec 23, 2010
Ellery Newcomer
Dec 23, 2010
Ellery Newcomer
Dec 23, 2010
Jonathan M Davis
Dec 23, 2010
Ellery Newcomer
Dec 23, 2010
Jonathan M Davis
December 23, 2010
quick question - will the following code do as I expect?

long x;

x = -1;

assert(x == -1);

cuz I've hit a spot where the optimizer isn't loading the high dword into x
December 23, 2010
On 12/22/2010 11:04 PM, Ellery Newcomer wrote:
> quick question - will the following code do as I expect?
>
> long x;
>
> x = -1;
>
> assert(x == -1);
>
> cuz I've hit a spot where the optimizer isn't loading the high dword into x

nevermind, it's failing with
x = cast(long) -1

and

x = -1L

also
December 23, 2010
On Wednesday 22 December 2010 21:04:37 Ellery Newcomer wrote:
> quick question - will the following code do as I expect?
> 
> long x;
> 
> x = -1;
> 
> assert(x == -1);
> 
> cuz I've hit a spot where the optimizer isn't loading the high dword into x

That would depend on what you expect. If you expect x to be equal 42, you're likely to be dissapointed. ;)

That said, it's definitely a bug if that assertion fails - an _enormous_ bug really. Regardless, it works just fine on my machine. So, whatever the optimizer does or doesn't do, the assertion doesn't fail.

- Jonathan M Davis
December 23, 2010
On 12/22/2010 11:10 PM, Jonathan M Davis wrote:
>
> That said, it's definitely a bug if that assertion fails - an _enormous_ bug
> really. Regardless, it works just fine on my machine.

try this on your machine:

http://d.puremagic.com/issues/show_bug.cgi?id=5364

>
> - Jonathan M Davis
December 23, 2010
On Wednesday 22 December 2010 21:57:06 Ellery Newcomer wrote:
> On 12/22/2010 11:10 PM, Jonathan M Davis wrote:
> > That said, it's definitely a bug if that assertion fails - an _enormous_ bug really. Regardless, it works just fine on my machine.
> 
> try this on your machine:
> 
> http://d.puremagic.com/issues/show_bug.cgi?id=5364
> 
> > - Jonathan M Davis

Without optimizations on, it works just fine, but it does fail on my machine when compiling with -O. Definitely a bug.

- Jonathan M Davis