This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] nonzero_bits (was Re: Another Java sparc-sun-solaris2.8 bootstrap failure)
On Wed, Mar 27, 2002 at 10:38:10PM +0100, Jakub Jelinek wrote:
> - reg_nonzero_bits[REGNO (x)]
> - |= nonzero_bits (src, nonzero_bits_mode);
> + if (reg_nonzero_bits[REGNO (x)] != ~(unsigned HOST_WIDE_INT) 0)
> + reg_nonzero_bits[REGNO (x)]
> + |= nonzero_bits (src, nonzero_bits_mode);
Good idea.
> - && reg_last_set_mode[REGNO (x)] == mode
> + && (reg_last_set_mode[REGNO (x)] == mode
> + || (GET_MODE_CLASS (reg_last_set_mode[REGNO (x)]) == MODE_INT
> + && GET_MODE_CLASS (mode) == MODE_INT))
Need to check that both modes fit HOST_BITS_PER_WIDE_INT, no?
> + enum machine_mode mode = GET_MODE (reg);
> subst_low_cuid = INSN_CUID (insn);
> - reg_last_set_mode[regno] = GET_MODE (reg);
> - reg_last_set_nonzero_bits[regno] = nonzero_bits (value, GET_MODE (reg));
> + reg_last_set_mode[regno] = mode;
> + if (GET_MODE_CLASS (mode) == MODE_INT)
> + mode = nonzero_bits_mode;
> + reg_last_set_nonzero_bits[regno] = nonzero_bits (value, mode);
Looks ok.
> if (SUBREG_PROMOTED_UNSIGNED_P (subreg))
> + /* XXX Is this correct even for MODE_INT modes
> + if reg_last_set_nonzero_bits was computed for
> + nonzero_bits_mode larger than reg_last_set_mode? */
> reg_last_set_nonzero_bits[regno] &= GET_MODE_MASK (mode);
Yes. SUBREG_PROMOTED_UNSIGNED_P is an affirmation.
r~