See subject. The problem manifests itself in my GSOC project and problem is
it's hard to narrow down.
So somebody fluent with Dustmite can you please try to trim it down?
The source is here:
https://dl.dropbox.com/u/7100999/blackwhale-phobos-phobos-2.052-2059-g6b6badc.zip
It's a phobos fork. Don't try to build it as a whole, it fails because of other compiler issues with const/forward reference (?).
However I use the following to test compilation only of my rewrite of std.regex alone:
rdmd --main std\regex.d
Output:
MultiArray!(BitPacked!(32u,uint),bool)
Assertion failure: 'semanticRun == PASSsemantic3done' on line 547 in file 'glue.c'
abnormal program termination
MultiArray is a pragma(msg, ...) and is irrelevant.
Comment #1 by dmitry.olsh — 2012-07-05T03:56:20Z
dmd being used is fresh git master
at commit ea1f2c95a445aeeb8c8e218ebbc861b37aa4215e.
Comment #2 by dmitry.olsh — 2012-07-22T04:31:39Z
Updated and re-tested with latest dmd from git.
https://dl.dropbox.com/u/7100999/phobos.zip
Message is the same, now line is 558.
I'll try dustmite'ing it though I'm no pro with it.
Never tried to narrow down the whole phobos and I recall it works worse on Windows so any help or tips are most appreciated.
Comment #3 by dmitry.olsh — 2012-07-22T08:18:56Z
Created attachment 1124
A reduced test case
Horay, dustmite makes wonders.
The end result is 2 modules ~10 lines each.
to test: extract somewhere & run
dmd std2/regex.d
Comment #4 by dmitry.olsh — 2012-07-22T08:30:32Z
Reduced by hand even futher:
//-----------in file uni.d
template BasicSetOps()
{
const opBinary(string op, U)(U )
if(is(typeof(U.init.isSet)) )
{
}
}
struct Set(T)
{
this(this)
{
}
mixin BasicSetOps;
}
//-----------in file regex.d
import std2.uni;
int[const(Set!uint)] trieCache;
void getTrie()
{
Set!(uint).init in trieCache;
}
All of lines seem equally important (postblit, mixed-in opBinary with exact constraint, usage of in operator on hash etc.)
Comment #5 by jens.k.mueller — 2012-12-12T05:55:50Z
Please look at 6395 whether it fixes this issue.
*** This issue has been marked as a duplicate of issue 6395 ***
Comment #6 by dmitry.olsh — 2012-12-12T06:49:29Z
Created attachment 1168
added missing module declaration
Comment #7 by dmitry.olsh — 2012-12-12T06:50:35Z
Still doesn't work for me on dmd lastest.
commit c4dc64092ae2ae8d774ae5d9b2af5b440dfff40f
Merge: c928446 9e36de3
Author: Walter Bright <[email protected]>
Date: Wed Dec 12 02:56:01 2012 -0800
Merge pull request #1367 from 9rnsr/fix9101
Issue 9101 - template mixin constructor causes link error
Now it prints:
Assertion failure: 'semanticRun == PASSsemantic3done' on line 572 in file 'glue.c'
abnormal program termination
Comment #8 by jens.k.mueller — 2012-12-12T06:56:31Z
Then either 6395 can not be considered fixed or this is not a duplicate of 6395? What do you think?
Comment #9 by dmitry.olsh — 2012-12-12T07:01:19Z
(In reply to comment #8)
> Then either 6395 can not be considered fixed or this is not a duplicate of
> 6395? What do you think?
I'm going to try testcase for 6395 to see.
Comment #10 by dmitry.olsh — 2012-12-12T07:41:26Z
(In reply to comment #9)
> (In reply to comment #8)
> > Then either 6395 can not be considered fixed or this is not a duplicate of
> > 6395? What do you think?
>
> I'm going to try testcase for 6395 to see.
Okay, I can confirm that testcase for 6395 passes for me.
So this is not a duplicate of 6395 but another related bug.
Comment #11 by bugzilla — 2012-12-12T20:17:21Z
A smaller test case:
struct Set(T)
{
this(this) { }
const opBinary(string op, U)(U)
if(is(typeof(U.init.isSet)) )
{
}
}
int[const(Set!uint)] trieCache;
void getTrie()
{
Set!(uint).init in trieCache;
}
Comment #12 by bugzilla — 2012-12-12T20:21:31Z
The error is that semantic2() and semantic3() are not run for Slot.__fieldPostBlit(). I'm pretty sure this is due to some processing being done while gagged and never completed.
The gagging thing is the worst architectural decision in the compiler, and I wish I'd never attempted it.
Comment #13 by bugzilla — 2012-12-12T22:13:10Z
Ok, here's the trouble. A postblit is generated for copying elements of the associated array, but the postblit fails to compile because postblit doesn't work on const arguments.
The error message was suppressed because it happened when errors were gagged. So things were in an invalid state when writing object files.
Unfortunately, the error message was lost, so I "fixed" it by putting out a generic message,
druntime\import\object.di(396): Error: function object.AssociativeArray!(const(Set!(uint)), int).AssociativeArray.Slot.__fieldPostBlit errors compiling the function
A better solution would be to find a better way to deal with gagged errors, but at least you can now see which function failed.
Comment #14 by github-bugzilla — 2012-12-12T22:14:09Z
(In reply to comment #13)
> Ok, here's the trouble. A postblit is generated for copying elements of the
> associated array, but the postblit fails to compile because postblit doesn't
> work on const arguments.
>
Now this highlights a bigger problem as AFAIK AA keys bascially supposed to be immutable...
Anyway good to see that ICE gone.
>Unfortunately, the error message was lost, so I "fixed" it by putting out a
> generic message,
>druntime\import\object.di(396): Error: function
>object.AssociativeArray!(const(Set!(uint)),
>int).AssociativeArray.Slot.__fieldPostBlit errors compiling the function
Well, line number is a start. I'll file a diagnostic bug then as user really shouldn't see this mess.