------- Additional Comments From schlie at comcast dot net 2005-01-16 17:39 ------- Subject: Re: usual arithmetic conversion not applying correctly
> From: schlie at comcast dot net <[EMAIL PROTECTED]> > ------- Additional Comments From schlie at comcast dot net 2005-01-16 07:16 > Subject: Re: usual arithmetic conversion not applying correctly > > Wonder if this PR could still be considered a missed optimization, as the > present logic which determines if an / or % expression's operands may be > shortened, misses the case where if the lhs operand is a constant, it may > be verified as not being INT_MIN; as if it's not, then it's impossible for > the operation to overflow, i.e. INT_MIN / -1 => INT_MAX+1, therefore > may be shortened. As noted as being absent in it's comment on shortening: > > /* Although it would be tempting to shorten always here, that loses > on some targets, since the modulo instruction is undefined if the > quotient can't be represented in the computation mode. We shorten > only if unsigned or if dividing by something we know != -1. */ - It would be unfortunate if / and % couldn't be somewhat further optimized prior to 4.0 when their lhs operands are known not to be INT_MIN, as they tend to be typically relatively expensive operations, likely benefiting from shortening more than most. > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18065 > > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18065