Re: [2/9] Encoding support for AArch64 DWARF operations

2016-11-16 Thread Jason Merrill
On Wed, Nov 16, 2016 at 12:50 PM, Jason Merrill  wrote:
> On Fri, Nov 11, 2016 at 1:33 PM, Jiong Wang  wrote:
>> The encoding for new added AARCH64 DWARF operations.
>
> This patch seems rather incomplete; I only see a change to
> dwarf2out.c, which won't compile since the opcodes aren't defined
> anywhere.

Sorry, now I see the rest of the patchset.

Jason


Re: [2/9] Encoding support for AArch64 DWARF operations

2016-11-16 Thread Jason Merrill
On Fri, Nov 11, 2016 at 1:33 PM, Jiong Wang  wrote:
> The encoding for new added AARCH64 DWARF operations.

This patch seems rather incomplete; I only see a change to
dwarf2out.c, which won't compile since the opcodes aren't defined
anywhere.

Jason


[2/9] Encoding support for AArch64 DWARF operations

2016-11-11 Thread Jiong Wang

The encoding for new added AARCH64 DWARF operations.

I am thinking DWARF specification actually allows vendor private operations
overlap with each other as one can't co-exist with the other.  So in theory we
should introduce target hook to handle target private operations.

But in GCC/binutils/LLVM scope, I only see one overlap between
DW_OP_GNU_push_tls_address and and DW_OP_HP_unknown, and DW_OP_HP_unknown seems
not used.

So I added the support in GCC generic code directly instead of introducing
target hook.

Is this OK to install?


gcc/
2016-11-11  Jiong Wang

* dwarf2out.c (size_of_loc_descr): Increase set for
DW_OP_AARCH64_pauth and DW_OP_AARCH64_paciasp_deref.
(output_loc_operands): Generate encoding for DW_OP_AARCH64_pauth
and DW_OP_AARCH64_paciasp_deref.
(output_loc_operands_raw): Likewise.

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 4a5c602f535fa49a45ae96f356f63c955dc527c6..fd159abe3c402cc8dedb0422e7b2680aabd28f93 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1698,6 +1698,12 @@ size_of_loc_descr (dw_loc_descr_ref loc)
 case DW_OP_GNU_parameter_ref:
   size += 4;
   break;
+case DW_OP_AARCH64_pauth:
+  size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
+  break;
+case DW_OP_AARCH64_paciasp_deref:
+  size += size_of_sleb128 (loc->dw_loc_oprnd1.v.val_int);
+  break;
 default:
   break;
 }
@@ -2177,6 +2183,13 @@ output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip)
   }
   break;
 
+case DW_OP_AARCH64_pauth:
+  dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
+  break;
+case DW_OP_AARCH64_paciasp_deref:
+  dw2_asm_output_data_sleb128 (val1->v.val_int, NULL);
+  break;
+
 default:
   /* Other codes have no operands.  */
   break;
@@ -2365,6 +2378,15 @@ output_loc_operands_raw (dw_loc_descr_ref loc)
   gcc_unreachable ();
   break;
 
+case DW_OP_AARCH64_pauth:
+  fputc (',', asm_out_file);
+  dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
+  break;
+case DW_OP_AARCH64_paciasp_deref:
+  fputc (',', asm_out_file);
+  dw2_asm_output_data_sleb128_raw (val1->v.val_int);
+  break;
+
 default:
   /* Other codes have no operands.  */
   break;