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 4/9] varasm.c: switch from POINTER_SIZE to targetm.pointer_size ()


On Mon, Jul 27, 2015 at 5:10 AM,  <tbsaunde+gcc@tbsaunde.org> wrote:
> From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
>
> gcc/ChangeLog:
>
> 2015-07-26  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
>
>         * varasm.c (assemble_addr_to_section): Call targetm.pointer_size ().
>         (dump_tm_clone_pairs): Likewise.
> ---
>  gcc/varasm.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/gcc/varasm.c b/gcc/varasm.c
> index 8cb2ec9..238ae39 100644
> --- a/gcc/varasm.c
> +++ b/gcc/varasm.c
> @@ -1543,8 +1543,8 @@ void
>  assemble_addr_to_section (rtx symbol, section *sec)
>  {
>    switch_to_section (sec);
> -  assemble_align (POINTER_SIZE);
> -  assemble_integer (symbol, pointer_size_units (), POINTER_SIZE, 1);
> +  assemble_align (targetm.pointer_size ());
> +  assemble_integer (symbol, pointer_size_units (), targetm.pointer_size (), 1);

That'll invoke the pointer size hook twice.  Refactoring assemble_integer to
avoid this would be nice.  Also caching the values in places like this.

Richard.

>  }
>
>  /* Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if
> @@ -5870,14 +5870,14 @@ dump_tm_clone_pairs (vec<tm_alias_pair> tm_alias_pairs)
>        if (!switched)
>         {
>           switch_to_section (targetm.asm_out.tm_clone_table_section ());
> -         assemble_align (POINTER_SIZE);
> +         assemble_align (targetm.pointer_size ());
>           switched = true;
>         }
>
>        assemble_integer (XEXP (DECL_RTL (src), 0),
> -                       pointer_size_units (), POINTER_SIZE, 1);
> +                       pointer_size_units (), targetm.pointer_size (), 1);
>        assemble_integer (XEXP (DECL_RTL (dst), 0),
> -                       pointer_size_units (), POINTER_SIZE, 1);
> +                       pointer_size_units (), targetm.pointer_size (), 1);
>      }
>  }
>
> --
> 2.4.0
>


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