This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: purge SETs of hard subregs


Andrew Haley wrote:
> 
>[snip]
> --- function.c  2000/09/15 18:30:11
> *************** purge_addressof (insns)
> *** 3393,3396 ****
> --- 3393,3462 ----
>     unshare_all_rtl_again (get_insns ());
>   }
> +
> + /* Convert a SET of a hard subreg to a set of the appropriet hard
                                                       ^^^^^^^^^ opps
> +    register.  A subroutine of purge_hard_subreg_sets.  */
> +
> + static void
> + purge_single_hard_subreg_set (pattern)
> +      rtx pattern;
> + {
> +   rtx reg = SET_DEST (pattern);
> +   enum machine_mode mode = GET_MODE (SET_DEST (pattern));
> +   int word = 0;
> +
> +   while (GET_CODE (reg) == SUBREG)
> +     {
> +       word += SUBREG_WORD (reg);
> +       reg = SUBREG_REG (reg);
> +     }
> +
> +   if (REGNO (reg) < FIRST_PSEUDO_REGISTER)
> +     {
> +       reg = gen_rtx_REG (mode, REGNO (reg) + word);
Silly question I assume here the we should only be generating a hard reg?
would it not be appropriate to check that REGNO (reg) + word < FIRST_P...
and if not abort?

> +       SET_DEST (pattern) = reg;
> +     }
> + }
> +
>[snip]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]