narrowed down the problem area
Sergey Gromov
snake.scaly at gmail.com
Sat Feb 16 00:23:05 PST 2008
downs <default_357-line at yahoo.de> wrote:
> For some reason, the bad case, although inlined, stores its values back into memory. The fast case keeps working with them.
>
> Here's the disassembly for ray_sphere for both cases:
>
> slow (opSub)
>
> http://paste.dprogramming.com/dpcds3p3
>
> fast
>
> http://paste.dprogramming.com/dpd6pi8n
>
> So it comes down to a GDC FP "bug". I think changing to 4.2 or 4.3 might help. Does anybody have an up-to-date version of the 4.2.x patch?
I'm trying to investigate this issue, too. I'm comparing the C++ code
generated by Visual C Express 2005, and GDC 0.24 based on GCC 3.4.5 and
DMD 1.020. Here's the commented out comparison of unitise() function:
http://paste.dprogramming.com/dpl9p4pt
As you can see, the code is very close. But the static opCall() which
initializes the by-value return struct is not inlined, and therefore not
optimized out. So there is an additional call and extra copying of
already calculated values. If not that, the code would be nearly
identical.
--
SnakE
More information about the Digitalmars-d
mailing list