Biv detection take 2
grahams
grahams@rcp.co.uk
Thu Apr 20 12:58:00 GMT 2000
Jan
This patch has bug if seq is a zero length SEQUNCE. The problem is
the following
last = XVECEXP (seq, 0, i - 1);
If seq is a zero length SEQUENCE then the above is accessing element
-1 (i.e. i is 0) which is wrong. I believe a zero length SEQUENCE is
possible if no insns are emitted between the calls to start_sequence()
and gen_sequence().
graham
Jan Hubicka wrote:
>
> Hi
cut
> /* It is entirely possible that the expansion created lots of new
> registers. Iterate over the sequence we just created and
> *************** emit_iv_add_mult (b, m, a, reg, insert_b
> *** 8102,8115 ****
> int i;
> for (i = 0; i < XVECLEN (seq, 0); ++i)
> {
> ! rtx set = single_set (XVECEXP (seq, 0, i));
> if (set && GET_CODE (SET_DEST (set)) == REG)
> record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
> }
> }
> ! else if (GET_CODE (seq) == SET
> ! && GET_CODE (SET_DEST (seq)) == REG)
> ! record_base_value (REGNO (SET_DEST (seq)), SET_SRC (seq), 0);
> }
>
> /* Test whether A * B can be computed without
> --- 8023,8069 ----
> int i;
> for (i = 0; i < XVECLEN (seq, 0); ++i)
> {
> ! set = single_set (XVECEXP (seq, 0, i));
> if (set && GET_CODE (SET_DEST (set)) == REG)
> record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
> }
> + last = XVECEXP (seq, 0, i - 1);
> }
> ! else
> ! {
> cut
More information about the Gcc-patches
mailing list