Unexpected results with doubles

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 7 23:18:06 UTC 2019


On Mon, Jan 07, 2019 at 09:42:42PM +0000, Joseph Malle via Digitalmars-d-learn wrote:
> On Monday, 7 January 2019 at 20:18:28 UTC, H. S. Teoh wrote:
> > Either there's memory corruption somewhere, or there's a codegen bug
> > in the compiler.
> 
> I think that must be it.  I ran it with ldc instead of dmd and it
> worked fine (solved the original problem! woohoo).
> 
> > Or the compiler somehow is  malfunctioning with -run.  Did you try
> > compiling the program separately and running it?  Does that make a
> > difference?
> 
> I did try doing it without -run and it had the same issue.
> 
> > The way to dig into the cause is to disassemble the radius()
> > function and post the disassembly here.  Then we can take a look to
> > find out what's going on.
> 
> What's the best way to get readable disassembly from dmd?  I tried
> godbolt but there was lots more stuff than I expected...

Hmm.  On Linux I'd use objdump:

	objdump -D myprogram | sed -ne'/radius/,/^$/p' > radius.disas

This extracts the assembly dump of the radius() function into the
file 'radius.disas'.

Not sure how to do this on a Mac.  (It should be possible to install
objdump on Mac, but I don't own a Mac so I've no idea.)


T

-- 
Why do conspiracy theories always come from the same people??


More information about the Digitalmars-d-learn mailing list