On Thu, Aug 18, 2016 at 11:33:06AM +0200, Pierre-Marie de Rodat wrote:
> Hello,
> 
> This enhances location description generation so that the generated
> opcodes for integer literals are as space-efficient when HOST_WIDE_INT
> is 64-bits large than when it's 32-bits large. In particular, this
> reduces the size of the opcodes generated to produce big unsigned
> literals using small literal integers instead.
> 
> Bootstrapped and regtested on x86-linux (no regression).  I also checked
> that the new testcase fails with mainline.  Ok to commit?  Thank you in
> advance!
> 
> gcc/
> 
>       * dwarf2out.c (int_loc_descriptor): Generate opcodes for another
>       equivalent 32-bit constant (modulo 2**32) when that yields
>       smaller instructions.
>       (size_of_int_loc_descriptor): Update accordingly.
> ---
>  gcc/dwarf2out.c                  | 31 ++++++++++++++++++++++++++-----
>  gcc/testsuite/gnat.dg/debug8.adb | 29 +++++++++++++++++++++++++++++
>  2 files changed, 55 insertions(+), 5 deletions(-)
>  create mode 100644 gcc/testsuite/gnat.dg/debug8.adb
> 
> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
> index 0fdab9a..f175ea1 100644
> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -11954,20 +11954,36 @@ int_loc_descriptor (HOST_WIDE_INT i)
>       /* DW_OP_const1u X DW_OP_litY DW_OP_shl takes just 4 bytes,
>          while DW_OP_const4u is 5 bytes.  */
>       return int_shift_loc_descriptor (i, HOST_BITS_PER_WIDE_INT - clz - 8);
> +
> +      else if (HOST_BITS_PER_WIDE_INT > 32

HOST_BITS_PER_WIDE_INT is now always 64, so you don't need that check.

Trev

Reply via email to