[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5455

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|D1  D2 |D2

--


[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2011-02-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5455


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #7 from Walter Bright bugzi...@digitalmars.com 2011-02-11 
22:59:37 PST ---
https://github.com/D-Programming-Language/dmd/commit/55da7194b3f626d1183fcd5404597749e4e21e15

https://github.com/D-Programming-Language/dmd/commit/bf6d6884d68783fb4007bfe6fa9f125a77538ef2

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


[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2011-01-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5455



--- Comment #5 from Don clugd...@yahoo.com.au 2011-01-25 00:27:34 PST ---
The bug was triggered by this change to SliceExp::toElem() (now line 4426):

---
elem *eptr = array_toPtr(e1-type, e);
-elem *elength = el_bin(OPmin, TYint, eupr, elwr2);
+elem *elength = el_bin(OPmin, TYsize_t, eupr, elwr2);
eptr = el_bin(OPadd, TYnptr, eptr, el_bin(OPmul, TYsize_t,
el_copytree(elwr2), el_long(TYsize_t, sz)));

e = el_pair(TYdarray, elength, eptr);
e = el_combine(elwr, e);
e = el_combine(einit, e);
---
Reverting this change removes the ICE.
TYsize_t is a TYuint, rather than a TYint.
Still, I don't understand why it makes any difference.

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


[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2011-01-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5455



--- Comment #6 from Don clugd...@yahoo.com.au 2011-01-25 13:07:25 PST ---
I think what's happened, is that a minor change to support 64 bits has
triggered a latent bug in the backend.

Basically, cgreg_assign() in cgreg.c thinks there are enough free registers. 
But allocreg() in cgcod.c can't find one. Although it is called with two
available registers, one of them is EBP, and EBP is disallowed in line 1910.
So these two functions are inconsistent.

I think the problem may be in creg_assign(). It thinks it has freed up a
register (EBX) which is used for 'this'. But (if I've correctly understood what
the code is doing) the same register seems to be used in a double-reg combo.
Seems a bit similar to bug 4443.
If I'm correct, then a solution to this bug would be to check if the register
is also part of a double-reg variable, before marking it as freed-up.

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


[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2011-01-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5455



--- Comment #3 from Don clugd...@yahoo.com.au 2011-01-18 12:44:11 PST ---
I think there's something wrong in cgcod.c, allocreg(). Might be good to have
an assert on line 1920:


r = mLSW;  /* see if there's an LSW also
*/
if (r)
lsreg = findreg(r);
else if (lsreg == -1)   /* if don't have LSW yet */
{   retregs = mLSW;
+   assert(retregs);
goto L3;
}
}

This fails. What happens is, we've found a register for the MSW. But we got
called with no available LSW registers!

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


[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2011-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5455


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

Summary|Optimization (register  |ICE(cgcod.c): Optimization
   |allocation?) regression in  |(register allocation?)
   |DMD 1.065   |regression in DMD 1.065
   Severity|normal  |regression


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


[Issue 5455] ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065

2011-01-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5455



--- Comment #2 from Don clugd...@yahoo.com.au 2011-01-17 11:44:32 PST ---
This is amazing. I have never before seen such an irreducible test case.
Here's the best I've been able to do.
-
void thrw(Data *s) {
throw new Exception(xxx);
}

struct Data {
Rapper *w;
uint n, m;
}

struct Rapper {
ubyte * dat;
ubyte[] con() {
return dat[0..1];
}
}

uint jaz(ubyte[] data) {
return data.length;
}

struct Resp {
void set(Data *data, string[] soup) {
switch(soup[0]) {
default:
}
uint[] f = [jaz(data.w ? data.w.con[data.n ..data.m] : null), data.m -
data.n];
thrw(data);
}
}

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