[Issue 6733] Regression(2.054) ICE(cod2.c) struct literals as template arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 21 05:07:01 PDT 2011


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



--- Comment #6 from Don <clugdbug at yahoo.com.au> 2011-10-21 05:05:58 PDT ---
Reduced test case:

void bug6733(int a, int b) pure nothrow { } 
void main() {
   int z;
   bug6733(z++, z++);
}

This is definitely a backend bug. What happens is, that since it's pure nothrow
and the result is unused, it's a no-side-effect call (OPcallns).
In the first optimisation step (optelem in cgelem.c), the call gets discarded,
and simply replaced with the parameter list (wrapped in an OPparam). If the
parameters had no side-effects, the whole thing would be discarded.
If there's only one with a side-effect, it's the only thing that's left. But if
there are TWO with side-effects, the OPparam remains.
The rest of the backend can't cope with a naked OPparam. Boom.
Solution would be to replace the OPparam with comma expressions.

-- 
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