D Compiler Bug?

Adam D. Ruppe destructionator at gmail.com
Tue Jan 29 00:17:22 UTC 2019


On Monday, 28 January 2019 at 23:57:09 UTC, Bottled Gin wrote:
> I am using LDC-1.14.0-beta1. The only way to upgrade is to 
> compile from source.
> What version is yours?

Mine is actually older, 1.12-beta but I was wrong; it actually 
did happen, I was just compiling it wrong. Sorry, my mistake.

So yeah, bug confirmed. Strange: it only happens with separate 
compilation. If you compile directly with ldc2 *.d, it all works.

The vtable seems to be wrapping around. So when we call func7, it 
goes back to func, func8 goes to func1, if we were to add a 
func9, it goes to func2.

ldc2 *.d # works correctly

for i in *.d; do ldc2 -c $i; done;
ldc2 *.o # produces the wrong code


huh, this is totally weird. And it happens with dmd as well as 
ldc, so it isn't a compiler specific thing; we have a frontend 
bug.

I gotta run, will look more later though.


More information about the Digitalmars-d mailing list