Fix reload ICE with define-split

Roman Zippel zippel@linux-m68k.org
Mon Feb 26 21:32:00 GMT 2007


Hi,

On Mon, 26 Feb 2007, Nathan Sidwell wrote:

> +static int
> +add_auto_inc_notes (rtx *xp, void *data)
> +{
> +  rtx x = *xp;
> +  rtx *notep = data;
> +
> +  if (GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC)
> +    {
> +      rtx reg = XEXP (x, 0);
> +      
> +      *notep = alloc_EXPR_LIST (REG_INC, reg, *notep);
> +    }
> +  
> +  return 0;
> +}

This would add notes for all autoinc expressions (even for newly created 
by the split) and repeat it for every REG_INC note, but only if there was 
one already before.
I'm not sure how we should handle new autoinc expressions, some ports 
already add a note in this case (e.g. sh), so my patch specifically only 
recreated existing notes.
If we want to create all new REG_INC notes, I think it would be better to 
call this from try_split() unconditionally.

> aha, I guess that's safe, because the split should not be creating an auto
> increment out of nothing.

It seems, that sh is doing something like this.

bye, Roman



More information about the Gcc-patches mailing list