condexec merge part 14

graham grahams@rcp.co.uk
Thu Apr 27 06:27:00 GMT 2000


Richard

Bootstrapping with --enable-checking picked up a problem with 
this part of your patch. A MEM is being passed to REGNO () which
triggers an abort.

I've indicated in an extract from your patch where this occurs.

Graham

> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/flow.c,v
> retrieving revision 1.267
> diff -c -p -d -r1.267 flow.c
> *** flow.c      2000/04/27 07:39:51     1.267
> --- flow.c      2000/04/27 10:56:14
>
snip
> *************** mark_set_1 (pbi, code, reg, cond, insn,
> *** 3980,3985 ****
> --- 3970,3976 ----
>        int flags;
>   {
>     int regno_first = -1, regno_last = -1;
> +   int not_dead = 0;
>     int i;
> 
>     /* Some targets place small structures in registers for
> *************** mark_set_1 (pbi, code, reg, cond, insn,
> *** 3995,4018 ****
> 
>     /* Modifying just one hardware register of a multi-reg value or just a
>        byte field of a register does not mean the value from before this insn
> !      is now dead.  But it does mean liveness of that register at the end of
> !      the block is significant.
> 
> !      Within mark_set_1, however, we treat it as if the register is indeed
> !      modified.  mark_used_regs will, however, also treat this register as
> !      being used.  Thus, we treat these insns as setting a new value for the
> !      register as a function of its old value.  This cases LOG_LINKS to be
> !      made appropriately and this will help combine.
> 
> !      ??? This is all done incorrectly.  We should not be setting bits in
> !      new_dead for these registers, since, as we just explained, they are
> !      not dead.  We should be setting bits in local_set, and updating
> !      LOG_LINKS, but that is different.  */
> 
> !   while (GET_CODE (reg) == SUBREG || GET_CODE (reg) == ZERO_EXTRACT
> !        || GET_CODE (reg) == SIGN_EXTRACT
> !        || GET_CODE (reg) == STRICT_LOW_PART)
> !     reg = XEXP (reg, 0);
> 
>     /* If this set is a MEM, then it kills any aliased writes.
>        If this set is a REG, then it kills any MEMs which use the reg.  */
> --- 3986,4065 ----
> 
>     /* Modifying just one hardware register of a multi-reg value or just a
>        byte field of a register does not mean the value from before this insn
> !      is now dead.  Of course, if it was dead after it's unused now.  */
> 
> !   switch (GET_CODE (reg))
> !     {
> !     case ZERO_EXTRACT:
> !     case SIGN_EXTRACT:
> !     case STRICT_LOW_PART:
> !       /* ??? Assumes STRICT_LOW_PART not used on multi-word registers.  */
> !       do
> !       reg = XEXP (reg, 0);
> !       while (GET_CODE (reg) == SUBREG
> !            || GET_CODE (reg) == ZERO_EXTRACT
> !            || GET_CODE (reg) == SIGN_EXTRACT
> !            || GET_CODE (reg) == STRICT_LOW_PART);

>>>>>>>	Here we apply REGNO () to a MEM ?

> !       not_dead = REGNO_REG_SET_P (pbi->reg_live, REGNO (reg));
> !       /* FALLTHRU */
> 
> !     case REG:
> !       regno_last = regno_first = REGNO (reg);
> !       if (regno_first < FIRST_PSEUDO_REGISTER)
> !       regno_last += HARD_REGNO_NREGS (regno_first, GET_MODE (reg)) - 1;
> !       break;

snip


More information about the Gcc-patches mailing list