[PATCH][debug] Handle debug references to skipped params

2018-07-08 Thread Tom de Vries
On Fri, Jul 06, 2018 at 04:38:50PM +0200, Richard Biener wrote:
> On Fri, Jul 6, 2018 at 12:47 PM Tom de Vries  wrote:
> > On 07/05/2018 01:39 PM, Richard Biener wrote:



> I now also spotted the code in remap_ssa_name that is supposed to handle
> this it seems and for the testcase we only give up because the PARM_DECL is
> remapped to a VAR_DECL.  So I suppose it is to be handled via the
> debug-args stuff
> which probably lacks in the area of versioning.
> 
> Your patch feels like it adds stuff ontop of existing mechanisms that
> should "just work"
> with the correct setup at the correct places...
> 

Hmm, I realized that I may be complicating things, by trying to do an
optimal fix in a single patch, so I decided to write two patches, one
with a fix, and then one improving the fix to be more optimal.

Also, I suspect that the "just work" approach is this:
...
   # DEBUG D#8 s=> iD.1900
   # DEBUG iD.1949 => D#8
   # DEBUG D#6 s=> iD.1949
...
whereas previously I tried to map 'D#6' on iD.1900 directly.

First patch OK for trunk?

[debug] Handle debug references to skipped params

When compiling guality/vla-1.c with -O3 -g, vla a in f1 is optimized away, but
f1 still contains a debug expression describing the upper bound of the vla
(D.1914):
...
 __attribute__((noinline))
 f1 (intD.6 iD.1900)
 {
   
   saved_stack.1_2 = __builtin_stack_save ();
   # DEBUG BEGIN_STMT
   # DEBUG D#3 => i_1(D) + 1
   # DEBUG D#2 => (long intD.8) D#3
   # DEBUG D#1 => D#2 + -1
   # DEBUG D.1914 => (sizetype) D#1
...

Then f1 is cloned to a version f1.constprop with no parameters, eliminating
parameter i, and 'DEBUG D#3 => i_1(D) + 1' turns into 'D#3 => NULL'.

This patch fixes that by defining debug expressions for default defs of
eliminated parameters in remap_ssa_name:
...
 __attribute__((noinline))
 f1.constprop ()
 {
   intD.6 iD.1949;

   
   # DEBUG D#8 s=> iD.1900
   # DEBUG iD.1949 => D#8

   
+  # DEBUG D#6 s=> iD.1949
   saved_stack.1_1 = __builtin_stack_save ();
   # DEBUG BEGIN_STMT
-  # DEBUG D#3 => NULL
+  # DEBUG D#3 => D#6 + 1
   # DEBUG D#2 => (long intD.8) D#3
   # DEBUG D#1 => D#2 + -1
   # DEBUG D.1951 => (sizetype) D#1
...

Bootstrapped and reg-tested on x86_64.

2018-07-07  Tom de Vries  

* cfgexpand.c (expand_debug_source_expr): Handle VAR_DECL.
* tree-inline.c (remap_ssa_name): Handle default def ssa_name mapping
onto VAR_DECL with abstract origin.

* gcc.dg/vla-1.c: New test.

---
 gcc/cfgexpand.c  |  4 
 gcc/testsuite/gcc.dg/vla-1.c | 25 +
 gcc/tree-inline.c|  4 +++-
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 9b91279282e..d6e3c382085 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -5141,6 +5141,10 @@ expand_debug_source_expr (tree exp)
 
   switch (TREE_CODE (exp))
 {
+case VAR_DECL:
+  if (DECL_ABSTRACT_ORIGIN (exp))
+   return expand_debug_source_expr (DECL_ABSTRACT_ORIGIN (exp));
+  break;
 case PARM_DECL:
   {
mode = DECL_MODE (exp);
diff --git a/gcc/testsuite/gcc.dg/vla-1.c b/gcc/testsuite/gcc.dg/vla-1.c
new file mode 100644
index 000..0c19feffd2b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vla-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O3 -fdump-tree-optimized" } */
+
+int __attribute__((noinline))
+f1 (int i)
+{
+  char a[i + 1];
+  char b[i + 2];
+  b[1] = 3;
+  a[0] = 5;
+  return a[0] + b[1];
+}
+
+int
+main ()
+{
+  volatile int j;
+  int x = 5;
+  j = f1 (x);
+  return 0;
+}
+
+/* One debug source bind is generated for the parameter, and two to describe 
the
+   sizes of a and b.  */
+/* { dg-final { scan-tree-dump-times " s=> i" 3 "optimized" } } */
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 427ef959740..6fbd8c3ca61 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -208,7 +208,9 @@ remap_ssa_name (tree name, copy_body_data *id)
  n = id->decl_map->get (val);
  if (n != NULL)
val = *n;
- if (TREE_CODE (val) != PARM_DECL)
+ if (TREE_CODE (val) != PARM_DECL
+ && !(TREE_CODE (val) == VAR_DECL
+  && DECL_ABSTRACT_ORIGIN (val)))
{
  processing_debug_stmt = -1;
  return name;


[PATCH][debug] Reuse debug exprs generated in remap_ssa_name

2018-07-08 Thread Tom de Vries
On Sun, Jul 08, 2018 at 11:22:41AM +0200, Tom de Vries wrote:
> On Fri, Jul 06, 2018 at 04:38:50PM +0200, Richard Biener wrote:
> > On Fri, Jul 6, 2018 at 12:47 PM Tom de Vries  wrote:
> > > On 07/05/2018 01:39 PM, Richard Biener wrote:
> 
> 
> 
> > I now also spotted the code in remap_ssa_name that is supposed to handle
> > this it seems and for the testcase we only give up because the PARM_DECL is
> > remapped to a VAR_DECL.  So I suppose it is to be handled via the
> > debug-args stuff
> > which probably lacks in the area of versioning.
> > 
> > Your patch feels like it adds stuff ontop of existing mechanisms that
> > should "just work"
> > with the correct setup at the correct places...
> > 
> 
> Hmm, I realized that I may be complicating things, by trying to do an
> optimal fix in a single patch, so I decided to write two patches, one
> with a fix, and then one improving the fix to be more optimal.
> 
> Also, I suspect that the "just work" approach is this:
> ...
># DEBUG D#8 s=> iD.1900
># DEBUG iD.1949 => D#8
># DEBUG D#6 s=> iD.1949
> ...
> whereas previously I tried to map 'D#6' on iD.1900 directly.
> 

Second patch OK for trunk?

Thanks,
- Tom

[debug] Reuse debug exprs generated in remap_ssa_name

When compiling gcc.dg/vla-1.c with -O3 -g, vla a and b in f1 are optimized
away, and f1 is cloned to a version f1.constprop with no parameters, eliminating
parameter i.  Debug info is generated to describe the sizes of a and b, but
that process generates debug expressions that are not reused.

Fix the duplication by saving and reusing the generated debug expressions in
remap_ssa_name.  Concretely: reuse D#7 here instead of generating D#8:
...
 __attribute__((noinline))
 f1.constprop ()
 {
   intD.6 iD.1935;

   
   # DEBUG D#10 s=> iD.1897
   # DEBUG iD.1935 => D#10

   
-  # DEBUG D#8 s=> iD.1935
   # DEBUG D#7 s=> iD.1935
   saved_stack.2_1 = __builtin_stack_save ();
   # DEBUG BEGIN_STMT
   # DEBUG D#6 => D#7 + 1
   # DEBUG D#5 => (long intD.8) D#6
   # DEBUG D#4 => D#5 + -1
   # DEBUG D.1937 => (sizetype) D#4
   # DEBUG a.0D.1942 => NULL
   # DEBUG BEGIN_STMT
-  # DEBUG D#3 => D#8 + 2
+  # DEBUG D#3 => D#7 + 2
   # DEBUG D#2 => (long intD.8) D#3
   # DEBUG D#1 => D#2 + -1
   # DEBUG D.1944 => (sizetype) D#1
   # DEBUG b.1D.1949 => NULL
...

Bootstrapped and reg-tested on x86_64.

2018-07-07  Tom de Vries  

* tree-inline.c (remap_ssa_name): Save and reuse debug exprs generated
in remap_ssa_name.

* gcc.dg/vla-1.c: Update.

---
 gcc/testsuite/gcc.dg/vla-1.c | 5 +++--
 gcc/tree-inline.c| 4 
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vla-1.c b/gcc/testsuite/gcc.dg/vla-1.c
index 0c19feffd2b..94db23d1336 100644
--- a/gcc/testsuite/gcc.dg/vla-1.c
+++ b/gcc/testsuite/gcc.dg/vla-1.c
@@ -20,6 +20,7 @@ main ()
   return 0;
 }
 
-/* One debug source bind is generated for the parameter, and two to describe 
the
+/* One debug source bind is generated for the parameter, and one to describe 
the
sizes of a and b.  */
-/* { dg-final { scan-tree-dump-times " s=> i" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " s=> i" 2 "optimized" } } */
+
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 6fbd8c3ca61..164c7fff710 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -215,12 +215,16 @@ remap_ssa_name (tree name, copy_body_data *id)
  processing_debug_stmt = -1;
  return name;
}
+ n = id->decl_map->get (val);
+ if (n && TREE_CODE (*n) == DEBUG_EXPR_DECL)
+   return *n;
  def_temp = gimple_build_debug_source_bind (vexpr, val, NULL);
  DECL_ARTIFICIAL (vexpr) = 1;
  TREE_TYPE (vexpr) = TREE_TYPE (name);
  SET_DECL_MODE (vexpr, DECL_MODE (SSA_NAME_VAR (name)));
  gsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)));
  gsi_insert_before (&gsi, def_temp, GSI_SAME_STMT);
+ insert_decl_map (id, val, vexpr);
  return vexpr;
}
 



Re: [PATCH] Fix PR86413

2018-07-08 Thread Jason Merrill
OK.

On Fri, Jul 6, 2018 at 8:14 PM, Richard Biener  wrote:
>
> The following fixes
>
> FAIL: gcc.dg/guality/pr48437.c   -O2 -flto -fno-use-linker-plugin
> -flto-partition=none  line 14 i == 0
>
> because we now prune non-local/VAR_DECLs from BLOCK trees during
> free-lang-data (after we emitted early dwarf).  gen_block_die
> isn't prepared for that and now refuses to add low/high-PC
> attributes to blocks that got all BLOCK_VARS stripped that way.
>
> The fix is to simply always emit them for early generated DIEs
> (so we only ever elide the DIE creation during early dwarf).
>
> Note this would allow us to prune BLOCK_VARS completely after
> early dwarf generation (but we need to keep the BLOCK tree itself
> for scoping obviously).
>
> Bootstrap / regtest running on x86_64-unknown-linux-gnu, ok?
>
> Thanks,
> Richard.
>
> 2018-07-06  Richard Biener  
>
> PR debug/86413
> * dwarf2out.c (gen_block_die): For an early generated DIE
> always output high/low PC attributes.
>
> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
> index a7c4620cfc3..95232177d83 100644
> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -25622,6 +25622,11 @@ gen_block_die (tree stmt, dw_die_ref context_die)
>  /* The outer scopes for inlinings *must* always be represented.  We
> generate DW_TAG_inlined_subroutine DIEs for them.  (See below.) */
>  must_output_die = 1;
> +  else if (BLOCK_DIE (stmt))
> +/* If we already have a DIE then it was filled early.  Meanwhile
> +   we might have pruned all BLOCK_VARS as optimized out but we
> +   still want to generate high/low PC attributes so output it.  */
> +must_output_die = 1;
>else
>  {
>/* Determine if this block directly contains any "significant"


Re: [PATCH][debug] Handle debug references to skipped params

2018-07-08 Thread Jakub Jelinek
On Sun, Jul 08, 2018 at 11:22:41AM +0200, Tom de Vries wrote:
> --- a/gcc/cfgexpand.c
> +++ b/gcc/cfgexpand.c
> @@ -5141,6 +5141,10 @@ expand_debug_source_expr (tree exp)
>  
>switch (TREE_CODE (exp))
>  {
> +case VAR_DECL:
> +  if (DECL_ABSTRACT_ORIGIN (exp))
> + return expand_debug_source_expr (DECL_ABSTRACT_ORIGIN (exp));
> +  break;
>  case PARM_DECL:
>{
>   mode = DECL_MODE (exp);

This is ok.

> diff --git a/gcc/testsuite/gcc.dg/vla-1.c b/gcc/testsuite/gcc.dg/vla-1.c
> new file mode 100644
> index 000..0c19feffd2b
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/vla-1.c
> @@ -0,0 +1,25 @@
> +/* { dg-do compile } */
> +/* { dg-options "-g -O3 -fdump-tree-optimized" } */
> +
> +
> +/* One debug source bind is generated for the parameter, and two to describe 
> the
> +   sizes of a and b.  */
> +/* { dg-final { scan-tree-dump-times " s=> i" 3 "optimized" } } */

I think you at least need explicit
-fvar-tracking-assignments -fno-selective-scheduling -fno-selective-scheduling2
and perhaps some guard to ignore the test on nvptx which disables
-fvar-tracking unconditionally?

> diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
> index 427ef959740..6fbd8c3ca61 100644
> --- a/gcc/tree-inline.c
> +++ b/gcc/tree-inline.c
> @@ -208,7 +208,9 @@ remap_ssa_name (tree name, copy_body_data *id)
> n = id->decl_map->get (val);
> if (n != NULL)
>   val = *n;
> -   if (TREE_CODE (val) != PARM_DECL)
> +   if (TREE_CODE (val) != PARM_DECL
> +   && !(TREE_CODE (val) == VAR_DECL
> +&& DECL_ABSTRACT_ORIGIN (val)))
>   {
> processing_debug_stmt = -1;
> return name;

Please use VAR_P macro.

Jakub


Re: [PATCH] C++: Fix PR86083

2018-07-08 Thread Jason Merrill
On Fri, Jul 6, 2018 at 5:20 PM, Andreas Krebbel  wrote:
> On 06/20/2018 01:41 PM, Andreas Krebbel wrote:
>> When turning a user-defined numerical literal into an operator
>> invocation the literal needs to be translated to the execution
>> character set.
>>
>> Bootstrapped and regtested on s390x. x86_64 still running.
>> Ok to apply if x86_64 is clean?
>>
>> Bye,
>>
>> -Andreas-
>>
>> gcc/cp/ChangeLog:
>>
>> 2018-06-20  Andreas Krebbel  
>>
>>   PR C++/86082
>>   * parser.c (make_char_string_pack):
>>   (cp_parser_userdef_numeric_literal):
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2018-06-20  Andreas Krebbel  
>>
>>   PR C++/86082
>>   * g++.dg/pr86082.C: New test.
>
> I've tested the patch also on GCC 7 and 8 branch. Ok to apply there as well?

Hmm, it seems safe enough, but also seems like a change with a limited
audience.  Would it work for you to include the patch just in your
builds of GCC 7 and 8?

Jason


[C++ Patch] Use rich_location::add_range in three more places

2018-07-08 Thread Paolo Carlini

Hi,

noticed three additional error messages where an additional range seems 
appropriate. Tested x86_64-linux.


Thanks, Paolo.

//

/cp
2018-07-08  Paolo Carlini  

* decl.c (grokdeclarator): Use rich_location::add_range in three
more places; include gcc-rich-location.h.

/testsuite
2018-07-08  Paolo Carlini  

* g++.dg/diagnostic/long-short.C: New.
* g++.dg/diagnostic/signed-unsigned.C: Likewise.
* g++.dg/diagnostic/virtual-friend.C: Likewise.
* g++.old-deja/g++.brendan/crash11.C: Adjust.
Index: cp/decl.c
===
--- cp/decl.c   (revision 262469)
+++ cp/decl.c   (working copy)
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "builtins.h"
 #include "gimplify.h"
 #include "asan.h"
+#include "gcc-rich-location.h"
 
 /* Possible cases of bad specifiers type used by bad_specifiers. */
 enum bad_spec_place {
@@ -10580,9 +10581,18 @@ grokdeclarator (const cp_declarator *declarator,
   int ok = 0;
 
   if (signed_p && unsigned_p)
-   error_at (loc, "% and % specified together");
+   {
+ gcc_rich_location richloc (declspecs->locations[ds_signed]);
+ richloc.add_range (declspecs->locations[ds_unsigned], false);
+ error_at (&richloc,
+   "% and % specified together");
+   }
   else if (long_p && short_p)
-   error_at (loc, "% and % specified together");
+   {
+ gcc_rich_location richloc (declspecs->locations[ds_long]);
+ richloc.add_range (declspecs->locations[ds_short], false);
+ error_at (&richloc, "% and % specified together");
+   }
   else if (TREE_CODE (type) != INTEGER_TYPE
   || type == char16_type_node || type == char32_type_node
   || ((long_p || short_p)
@@ -10723,7 +10733,7 @@ grokdeclarator (const cp_declarator *declarator,
 {
   if (staticp == 2)
{
- rich_location richloc (line_table, declspecs->locations[ds_virtual]);
+ gcc_rich_location richloc (declspecs->locations[ds_virtual]);
  richloc.add_range (declspecs->locations[ds_storage_class], false);
  error_at (&richloc, "member %qD cannot be declared both % "
"and %", dname);
@@ -10732,7 +10742,7 @@ grokdeclarator (const cp_declarator *declarator,
}
   if (constexpr_p)
{
- rich_location richloc (line_table, declspecs->locations[ds_virtual]);
+ gcc_rich_location richloc (declspecs->locations[ds_virtual]);
  richloc.add_range (declspecs->locations[ds_constexpr], false);
  error_at (&richloc, "member %qD cannot be declared both % "
"and %", dname);
@@ -11270,8 +11280,9 @@ grokdeclarator (const cp_declarator *declarator,
if (virtualp)
  {
/* Cannot be both friend and virtual.  */
-   error_at (declspecs->locations[ds_friend],
- "virtual functions cannot be friends");
+   gcc_rich_location richloc 
(declspecs->locations[ds_virtual]);
+   richloc.add_range (declspecs->locations[ds_friend], false);
+   error_at (&richloc, "virtual functions cannot be friends");
friendp = 0;
  }
if (decl_context == NORMAL)
Index: testsuite/g++.dg/diagnostic/long-short.C
===
--- testsuite/g++.dg/diagnostic/long-short.C(nonexistent)
+++ testsuite/g++.dg/diagnostic/long-short.C(working copy)
@@ -0,0 +1,12 @@
+// { dg-options "-fdiagnostics-show-caret" }
+
+long short int a;  // { dg-error "1:.long. and .short. specified together" }
+/* { dg-begin-multiline-output "" }
+ long short int a;
+ ^~~~ ~
+   { dg-end-multiline-output "" } */
+short long int b;  // { dg-error "7:.long. and .short. specified together" }
+/* { dg-begin-multiline-output "" }
+ short long int b;
+ ~ ^~~~
+   { dg-end-multiline-output "" } */
Index: testsuite/g++.dg/diagnostic/signed-unsigned.C
===
--- testsuite/g++.dg/diagnostic/signed-unsigned.C   (nonexistent)
+++ testsuite/g++.dg/diagnostic/signed-unsigned.C   (working copy)
@@ -0,0 +1,12 @@
+// { dg-options "-fdiagnostics-show-caret" }
+
+signed unsigned int a;  // { dg-error "1:.signed. and .unsigned. specified 
together" }
+/* { dg-begin-multiline-output "" }
+ signed unsigned int a;
+ ^~ 
+   { dg-end-multiline-output "" } */
+unsigned signed int b;  // { dg-error "10:.signed. and .unsigned. specified 
together" }
+/* { dg-begin-multiline-output "" }
+ unsigned signed int b;
+  ^~
+   { dg-end-multiline-output "" } */
Index: testsuite/g++.dg/diagnostic/virtual-friend.C
===
--- testsuite/g++.dg/diagnostic/vi

[PATCH, doc] Small clarification on define_subst

2018-07-08 Thread Paul Koning
In doing CCmode work I was confused how define_subst handles cases where the 
same argument appears more than once.  The attached clarifies this.

Ok for trunk?

paul

ChangeLog:

2018-07-08  Paul Koning  

* doc/md.texi (define_subst): Document how multiple occurrences of
the same argument in the replacement pattern are handled.

Index: doc/md.texi
===
--- doc/md.texi (revision 262505)
+++ doc/md.texi (working copy)
@@ -10263,7 +10263,11 @@ the expression from the original pattern, which ma
 @code{match_operand N} from the input pattern.  As a consequence,
 @code{match_dup} cannot be used to point to @code{match_operand}s from
 the output pattern, it should always refer to a @code{match_operand}
-from the input pattern.
+from the input pattern.  If a @code{match_dup N} occurs more than once
+in the output template, its first occurrence is replaced with the
+expression from the original pattern, and the subsequent expressions
+are replaced with @code{match_dup N}, i.e., a reference to the first
+expression.
 
 In the output template one can refer to the expressions from the
 original pattern and create new ones.  For instance, some operands could



Re: [PATCH v3] [aarch64] Add HiSilicon tsv110 CPU support

2018-07-08 Thread Zhangshaokun
Hi maintainers,

A gentle ping.

Thanks,
Shaokun

On 2018/6/21 19:13, Shaokun Zhang wrote:
> This patch adds HiSilicon's an mcpu: tsv110, which supports v8_4A.
> It has been tested on aarch64 and no regressions from this patch.
> 
> ---
>  gcc/ChangeLog|   8 +++
>  gcc/config/aarch64/aarch64-cores.def |   3 +
>  gcc/config/aarch64/aarch64-cost-tables.h | 103 
> +++
>  gcc/config/aarch64/aarch64-tune.md   |   2 +-
>  gcc/config/aarch64/aarch64.c |  82 
>  gcc/doc/invoke.texi  |   2 +-
>  6 files changed, 198 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index d9fbc0c..f5538f7 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,11 @@
> +2018-06-21  Shaokun Zhang  
> +Bo Zhou  
> +   * config/aarch64/aarch64-cores.def (tsv110): New CPU.
> +   * config/aarch64/aarch64-tune.md: Regenerated.
> +   * doc/invoke.texi (AArch64 Options/-mtune): Add "tsv110".
> +   * config/aarch64/aarch64.c (tsv110_tunings): New tuning table.
> +   * config/aarch64/aarch64-cost-tables.h: Add "tsv110" extra costs.
> +
>  2018-06-21  Richard Biener  
>  
>   * tree-data-ref.c (dr_step_indicator): Handle NULL DR_STEP.
> diff --git a/gcc/config/aarch64/aarch64-cores.def 
> b/gcc/config/aarch64/aarch64-cores.def
> index e64d831..e6ebf02 100644
> --- a/gcc/config/aarch64/aarch64-cores.def
> +++ b/gcc/config/aarch64/aarch64-cores.def
> @@ -88,6 +88,9 @@ AARCH64_CORE("cortex-a75",  cortexa75, cortexa57, 8_2A,  
> AARCH64_FL_FOR_ARCH8_2
>  
>  /* ARMv8.4-A Architecture Processors.  */
>  
> +/* HiSilicon ('H') cores. */
> +AARCH64_CORE("tsv110", tsv110,cortexa57,8_4A, 
> AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_F16 | AARCH64_FL_AES 
> | AARCH64_FL_SHA2, tsv110,   0x48, 0xd01, -1)
> +
>  /* Qualcomm ('Q') cores. */
>  AARCH64_CORE("saphira", saphira,falkor,8_4A,  
> AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_RCPC, saphira,   
> 0x51, 0xC01, -1)
>  
> diff --git a/gcc/config/aarch64/aarch64-cost-tables.h 
> b/gcc/config/aarch64/aarch64-cost-tables.h
> index a455c62..44095ce 100644
> --- a/gcc/config/aarch64/aarch64-cost-tables.h
> +++ b/gcc/config/aarch64/aarch64-cost-tables.h
> @@ -334,4 +334,107 @@ const struct cpu_cost_table thunderx2t99_extra_costs =
>}
>  };
>  
> +const struct cpu_cost_table tsv110_extra_costs =
> +{
> +  /* ALU */
> +  {
> +0, /* arith.  */
> +0, /* logical.  */
> +0, /* shift.  */
> +0, /* shift_reg.  */
> +COSTS_N_INSNS (1), /* arith_shift.  */
> +COSTS_N_INSNS (1), /* arith_shift_reg.  */
> +COSTS_N_INSNS (1), /* log_shift.  */
> +COSTS_N_INSNS (1), /* log_shift_reg.  */
> +0, /* extend.  */
> +COSTS_N_INSNS (1), /* extend_arith.  */
> +0, /* bfi.  */
> +0, /* bfx.  */
> +0, /* clz.  */
> +0,  /* rev.  */
> +0, /* non_exec.  */
> +true   /* non_exec_costs_exec.  */
> +  },
> +  {
> +/* MULT SImode */
> +{
> +  COSTS_N_INSNS (2),   /* simple.  */
> +  COSTS_N_INSNS (2),   /* flag_setting.  */
> +  COSTS_N_INSNS (2),   /* extend.  */
> +  COSTS_N_INSNS (2),   /* add.  */
> +  COSTS_N_INSNS (2),   /* extend_add.  */
> +  COSTS_N_INSNS (11)   /* idiv.  */
> +},
> +/* MULT DImode */
> +{
> +  COSTS_N_INSNS (3),   /* simple.  */
> +  0,   /* flag_setting (N/A).  */
> +  COSTS_N_INSNS (3),   /* extend.  */
> +  COSTS_N_INSNS (3),   /* add.  */
> +  COSTS_N_INSNS (3),   /* extend_add.  */
> +  COSTS_N_INSNS (19)   /* idiv.  */
> +}
> +  },
> +  /* LD/ST */
> +  {
> +COSTS_N_INSNS (3), /* load.  */
> +COSTS_N_INSNS (4), /* load_sign_extend.  */
> +COSTS_N_INSNS (3), /* ldrd.  */
> +COSTS_N_INSNS (3), /* ldm_1st.  */
> +1, /* ldm_regs_per_insn_1st.  */
> +2, /* ldm_regs_per_insn_subsequent.  */
> +COSTS_N_INSNS (4), /* loadf.  */
> +COSTS_N_INSNS (4), /* loadd.  */
> +COSTS_N_INSNS (4), /* load_unaligned.  */
> +0, /* store.  */
> +0, /* strd.  */
> +0, /* stm_1st.  */
> +1, /* stm_regs_per_insn_1st.  */
> +2, /* stm_regs_per_insn_subsequent.  */
> +0, /* storef.  */
> +0, /* stored.  */
> +COSTS_N_INSNS (1), /* store_unaligned.  */
> +COSTS_N_INSNS (4), /* loadv.  */
> +COSTS_N_INSNS (4)  /* storev.  */
> +  },
> +  {
> +/* FP SFmode */
> +{
> +