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]
Other format: [Raw text]

Re: [PATCH] Remove redundant variable in hash_set


On Mon, Nov 26, 2012 at 1:09 PM, Marek Polacek <polacek@redhat.com> wrote:
> I don't see why we need the `hash' variable, when we can use the
> `regno' variable directly.  Regtested/bootstrapped on x86_64-linux.
> Ok for trunk?

Ok.

Thanks,
Richard.

> 2012-11-26  Marek Polacek  <polacek@redhat.com>
>
>         * cprop.c (hash_set): Remove hash variable.  Use regno
>         variable directly.
>
> --- gcc/cprop.c.mp      2012-11-26 12:13:08.631193625 +0100
> +++ gcc/cprop.c 2012-11-26 12:13:25.836238566 +0100
> @@ -170,10 +170,7 @@ reg_available_p (const_rtx x, const_rtx
>  static unsigned int
>  hash_set (int regno, int hash_table_size)
>  {
> -  unsigned int hash;
> -
> -  hash = regno;
> -  return hash % hash_table_size;
> +  return (unsigned) regno % hash_table_size;
>  }
>
>  /* Insert assignment DEST:=SET from INSN in the hash table.
>
>         Marek


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