[Issue 9969] dmd ABI mistake (cfloat static array initialisation)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 20 11:12:36 PDT 2013


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



--- Comment #4 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-04-20 11:12:35 PDT ---
(In reply to comment #2)
> (In reply to comment #1)
> > Looks like an issue 9449.
> > 
> > I think the problem isn't  "ABI mistake" (or a codegen bug as often mentioned
> > here - many people who can spot an error from asm output tend to blame backend)
> > but absence of crosstalk between how dmd assumes memset functions look like and
> > how they are actually defined in druntime.
> 
> I'm confused as to how trying to pass a variable on the stack to an extern(C)
> function with less than 6 arguments on linux x64 is not a codegen error of some
> sorts. It's using the wrong calling convention...

I do not think that if you can see that compiler passes arguments wrong you may
conclude that it is codegen or ABI bug. That is what actually often happens:
somebody see error in asm output and blames backend while the problem is really
in frontend. From what I know after debugging issue 9449 there is likely error
in scope of AssignExp::toElem
(https://github.com/D-Programming-Language/dmd/blob/master/src/e2ir.c#L2688)
(or setArray()) which does not handle properly cases like this. The problem is
in frontend assumption that druntime defines memset function as taking dynamic
array. The backend just does what it is told to generate.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list