On Thu Mar 20 17:51:30 EDT 2014, quans...@quanstro.net wrote: > On Thu Mar 20 16:20:29 EDT 2014, cinap_len...@felloff.net wrote: > > sorry... the code from the last mail contains an error... > > theres a missing regfree() in the OASMUL and OASLMUL case when > > hardleft is set. in any case, i'm unsure if it wouldnt be > > better to handle this in mulgen() instead. as this case is > > so rare, it is probably not worth trying to avoid useless > > register moves here. > > i suppose you can make the test for a constant expression fail, by simply > changing both instances of this > if(r->op == OCONST && typechl[n->type->etype]) { > to this > if(r->op == OCONST && r->vconst != 0 && > typechl[n->type->etype]) { > > i haven't thought too hard about this, or compiled it, so maybe too easy?
on second thought, better maching would be better. only multplication by 0 is safe. - erik