https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61757

--- Comment #29 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #21)
> (In reply to Pat Haugen from comment #19)
> > So in the case where MIN_INT32 is passed (sign extended), the upper 32 bits
> > are '1' so r212352 returns a value of 63 whereas prior revisions returned a
> > value of 31.
> 
> When called with r3=ffffffff80000000 the new code
> returns -1 as far as I can see?

The new code is doing a logical shift right of the full 64-bit reg, which will
require 63 shifts for the value in the reg to become zero.


> And it should be called with 0000000080000000 instead;
> does the caller not have a prototype in scope?

No, there is no prototype, which is really the problem because it should be
passed zero-extended as you say in which case either of the code sequences
would work.

I tried the benchmark after the patch went in, and it is back to generating the
rldicl insn and the benchmark passes.

Reply via email to