RE: [PATCH PR95254] aarch64: gcc generate inefficient code with fixed sve vector length

2020-05-31 Thread Yangfei (Felix)
Hi,

> -Original Message-
> From: Richard Sandiford [mailto:richard.sandif...@arm.com]
> Sent: Sunday, May 31, 2020 12:01 AM
> To: Yangfei (Felix) 
> Cc: gcc-patches@gcc.gnu.org; Uros Bizjak ; Jakub
> Jelinek ; Hongtao Liu ; H.J. Lu
> 
> Subject: Re: [PATCH PR95254] aarch64: gcc generate inefficient code with
> fixed sve vector length
> 

Snip...

> >
> > The v5 patch attached addressed this issue.
> >
> > There two added changes compared with the v4 patch:
> > 1. In candidate_mem_p, mov_optab for innermode should be available.
> >  In this case, mov_optab for SDmode is not there and subreg are added
> back by emit_move_insn_1.  So we won't get the benefit with the patch.
> 
> I agree we should have this check.  I think the rule applies to all of the
> transforms though, not just the mem one, so we should add the check to the
> register and constant cases too.

OK.  I changed to make this an extra condition for calculating x_inner & y 
_inner.

> > 2. Instead of using adjust_address, I changed to use adjust_address_nv to
> avoid the emit of invalid insn 13.
> > The latter call to validize_mem() in emit_move_insn will take care of 
> > the
> address for us.
> 
> The validation performed by validize_mem is the same as that performed by
> adjust_address, so the only case this should make a difference is for
> push_operands:

True.

>   /* If X or Y are memory references, verify that their addresses are valid
>  for the machine.  */
>   if (MEM_P (x)
>   && (! memory_address_addr_space_p (GET_MODE (x), XEXP (x, 0),
>MEM_ADDR_SPACE (x))
> && ! push_operand (x, GET_MODE (x
> x = validize_mem (x);
> 
>   if (MEM_P (y)
>   && ! memory_address_addr_space_p (GET_MODE (y), XEXP (y, 0),
>   MEM_ADDR_SPACE (y)))
> y = validize_mem (y);
> 
> So I think the fix is to punt on push_operands instead (and continue to use
> adjust_address rather than adjust_address_nv).

Not sure if I understand it correctly.
Do you mean excluding push_operand in candidate_mem_p? Like:

 3830   auto candidate_mem_p = [&](machine_mode innermode, rtx mem) {
 3831 return !targetm.can_change_mode_class (innermode, GET_MODE (mem), 
ALL_REGS)
 3832&& !push_operand (mem, GET_MODE (mem))
 3833/* Not a candiate if innermode requires too much alignment.  */
 3834&& (MEM_ALIGN (mem) >= GET_MODE_ALIGNMENT (innermode)
 3835|| targetm.slow_unaligned_access (GET_MODE (mem),
 3836  MEM_ALIGN (mem))
 3837|| !targetm.slow_unaligned_access (innermode, MEM_ALIGN 
(mem)));
 3838   };

Thanks,
Felix


[PATCH] [stage1] ipa-cp: Fix PGO regression caused by r278808

2020-05-31 Thread Xionghu Luo via Gcc-patches
resend the patch for stage1:
https://gcc.gnu.org/pipermail/gcc-patches/2020-January/538186.html

The performance of exchange2 built with PGO will decrease ~28% by r278808
due to profile count set incorrectly.  The cloned nodes are updated to a
very small count caused later pass cunroll fail to unroll the recursive
function in exchange2.

digits_2 ->
digits_2.constprop.0, digits_2.constprop.1, etc.

1. Enable proportion orig_sum to the new nodes for self recursive node
   (k means multiple self recursive calls):
   new_sum = (orig_sum + new_sum) * 1 / k \
   * self_recursive_probability * (1 / param_ipa_cp_max_recursive_depth).
2. Two mutually recursive functions are not supported in self recursive
   clone yet so also not supported in update_profiling_info here.
3. Improve value range for param_ipa_cp_max_recursive_depth to (0, 8).
   If it calls itself two different sets, usually recursive boudary limit
   will stop the specialize first, otherwise it is slow even without
   recursive specialize.

gcc/ChangeLog:

2020-05-29  Xionghu Luo  

* ipa-cp.c (update_profiling_info): Check self_scc node.
* params.opt (ipa-cp-max-recursive-depth): Set param range.

gcc/testsuite/ChangeLog:

2020-05-29  Xionghu Luo  

* gcc.dg/ipa/ipa-clone-3.c: Update count.
---
 gcc/ipa-cp.c   | 33 +-
 gcc/params.opt |  2 +-
 gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c |  2 +-
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index c64e9104a94..919c741ecfa 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -2046,7 +2046,7 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
   /* Recursively generate lattice values with a limited count.  */
   FOR_EACH_VEC_ELT (val_seeds, i, src_val)
{
- for (int j = 1; j < max_recursive_depth; j++)
+ for (int j = 0; j < max_recursive_depth; j++)
{
  tree cstval = get_val_across_arith_op (opcode, opnd1_type, opnd2,
 src_val, res_type);
@@ -4345,6 +4345,37 @@ update_profiling_info (struct cgraph_node *orig_node,
  false);
   new_sum = stats.count_sum;
 
+  class ipa_node_params *info = IPA_NODE_REF (orig_node);
+  if (info && info->node_is_self_scc)
+{
+  profile_count self_recursive_count = profile_count::zero ();
+  unsigned k = 0;
+
+  /* The self recursive edge is on the orig_node.  */
+  for (cs = orig_node->callees; cs; cs = cs->next_callee)
+   if (ipa_edge_within_scc (cs))
+ {
+   cgraph_node *callee = cs->callee->function_symbol ();
+   if (callee && cs->caller == cs->callee)
+ {
+   self_recursive_count += cs->count;
+   k++;
+ }
+ }
+
+  /* Proportion count for multiple self recursive node.  */
+  if (k)
+   self_recursive_count.apply_scale (1, k);
+
+  /* Proportion count for self recursive node from all callers.  */
+  new_sum
+   = (orig_sum + new_sum).apply_scale (self_recursive_count, orig_sum);
+
+  /* Proportion count for specialized cloned node.  */
+  if (param_ipa_cp_max_recursive_depth)
+   new_sum = new_sum.apply_scale (1, param_ipa_cp_max_recursive_depth);
+}
+
   if (orig_node_count < orig_sum + new_sum)
 {
   if (dump_file)
diff --git a/gcc/params.opt b/gcc/params.opt
index 4aec480798b..ad000145dfb 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -199,7 +199,7 @@ Common Joined UInteger Var(param_ipa_cp_loop_hint_bonus) 
Init(64) Param Optimiza
 Compile-time bonus IPA-CP assigns to candidates which make loop bounds or 
strides known.
 
 -param=ipa-cp-max-recursive-depth=
-Common Joined UInteger Var(param_ipa_cp_max_recursive_depth) Init(8) Param 
Optimization
+Common Joined UInteger Var(param_ipa_cp_max_recursive_depth) Init(7) 
IntegerRange(0, 8) Param Optimization
 Maximum depth of recursive cloning for self-recursive function.
 
 -param=ipa-cp-min-recursive-probability=
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c 
b/gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c
index a73cb8b63fc..1efa23ae109 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-clone-3.c
@@ -41,4 +41,4 @@ int main ()
   return recur_fn ();
 }
 
-/* { dg-final { scan-ipa-dump-times "Creating a specialized node of 
recur_fn/\[0-9\]*\\." 8 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of 
recur_fn/\[0-9\]*\\." 9 "cp" } } */
-- 
2.21.0.777.g83232e3864



[committed] wwwdocs: Update link for ARC.

2020-05-31 Thread Gerald Pfeifer
Pushed.

---
 htdocs/readings.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/readings.html b/htdocs/readings.html
index 3d654a37..2488ca9d 100644
--- a/htdocs/readings.html
+++ b/htdocs/readings.html
@@ -78,7 +78,7 @@ names.
  arc
   Manufacturer: Synopsys Inc (as Synopsys DesignWare softcore)
   CPUs include: ARC600, ARC700
-  https://www.synopsys.com/designware-ip/processor-solutions/arc-processors.html;>ARC
 Documentation
+  https://www.synopsys.com/designware-ip/processor-solutions.html;>ARC 
Documentation
  
 
  ARM
-- 
2.26.2


[committed] libstdc++: Switch www.cs.princeton.edu to https

2020-05-31 Thread Gerald Pfeifer
My first libstdc+++ commit in the new (ChangeLog) new (Git) world
order, so particularly happy for advise on any mistakes or potential 
improvements.

(Apart from the stray change that sneaked into the .xml file in the
last minute somehow :-( -- that one's resolved already.)

Pushed.

Gerald

* doc/xml/manual/policy_data_structures_biblio.xml: Switch
www.cs.princeton.edu to https.
* doc/html/manual/policy_data_structures.html: Regenerate.
---
 libstdc++-v3/doc/html/manual/policy_data_structures.html  | 2 +-
 libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures.html 
b/libstdc++-v3/doc/html/manual/policy_data_structures.html
index efb3b12237b..5c3498e5b65 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures.html
@@ -1037,7 +1037,7 @@
  . 
  Addison-Wesley Publishing Company
. [biblio.kt99fat_heaps] wwwdocs: 
-   http://www.cs.princeton.edu/research/techreps/TR-597-99; target="_top">
+   https://www.cs.princeton.edu/research/techreps/TR-597-99; target="_top">
  New Heap Data Structures

   . 
diff --git a/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml 
b/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml
index 1e2845bfb5c..39bd2e70b7f 100644
--- a/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml
+++ b/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml
@@ -1,4 +1,4 @@
-
+B
 
 http://docbook.org/ns/docbook; version="5.0"
  xml:id="pbds.biblio" xreflabel="Bibliography">
@@ -738,7 +738,7 @@
 
   
http://www.w3.org/1999/xlink;
- 
xlink:href="http://www.cs.princeton.edu/research/techreps/TR-597-99;>
+ 
xlink:href="https://www.cs.princeton.edu/research/techreps/TR-597-99;>
  New Heap Data Structures

   
-- 
2.26.2


[committed] wwwdocs: Remove duplicate (old) Blackfin reference.

2020-05-31 Thread Gerald Pfeifer
Pushed.

Gerald
---
 htdocs/readings.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/htdocs/readings.html b/htdocs/readings.html
index 09420335..3d654a37 100644
--- a/htdocs/readings.html
+++ b/htdocs/readings.html
@@ -94,7 +94,6 @@ names.
 
  Blackfin
   Manufacturer: Analog Devices
-  https://www.analog.com/en/products/processors-dsp/dsp/blackfin.html;>Blackfin
 Documentation
   https://www.analog.com/en/products/processors-microcontrollers/processors-dsp/blackfin-embedded-processors.html;>Blackfin
 Documentation
  
 
-- 
2.26.2


[committed] wwwdocs: Update reference to Intel's pcommit deprecation.

2020-05-31 Thread Gerald Pfeifer
Pushed.

Gerald
---
 htdocs/gcc-5/changes.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/gcc-5/changes.html b/htdocs/gcc-5/changes.html
index 536ab6c0..efa322b1 100644
--- a/htdocs/gcc-5/changes.html
+++ b/htdocs/gcc-5/changes.html
@@ -1084,7 +1084,7 @@ are not listed here).
 IA-32/x86-64
   
 Support for the https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction;>deprecated
+
href="https://software.intel.com/content/www/us/en/develop/blogs/deprecate-pcommit-instruction.html;>deprecated
 pcommit instruction has been removed.
   
 
-- 
2.26.2


[PATCH 0/2] x86: Add cmpmemsi for -minline-all-stringops

2020-05-31 Thread H.J. Lu via Gcc-patches
We used to expand memcmp to "repz cmpsb" via cmpstrnsi.  It was changed
by

commit 9b0f6f5e511ca512e4faeabc81d2fd3abad9b02f
Author: Nick Clifton 
Date:   Fri Aug 12 16:26:11 2011 +

builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi pattern.

* builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi
pattern.
* doc/md.texi (cmpstrn): Note that the comparison stops if both
fetched bytes are zero.
(cmpstr): Likewise.
(cmpmem): Note that the comparison does not stop if both of the
fetched bytes are zero.

Duplicate the cmpstrn pattern for cmpmem and expand cmpmem to "repz cmpsb"
for -minline-all-stringops.  The only difference is that the length
argument of cmpmem is guaranteed to be less than or equal to lengths of
2 memory areas.  Since cmpmem expander may pass the actual string length
directly to cmpstrnqi patterns.  Pass a copy of the string length to
cmpstrnqi patterns to avoid changing the actual string length by cmpstrnqi
patterns.

Tested on Linux/x86 and Linux/x86-64.  OK for master?

H.J. Lu (2):
  x86: Pass a copy of the string length to cmpstrnqi
  x86: Add cmpmemsi for -minline-all-stringops

 gcc/config/i386/i386-expand.c |  84 ++
 gcc/config/i386/i386-protos.h |   1 +
 gcc/config/i386/i386.md   |  80 -
 gcc/testsuite/gcc.target/i386/pr95151-1.c |  17 +++
 gcc/testsuite/gcc.target/i386/pr95151-2.c |  10 ++
 gcc/testsuite/gcc.target/i386/pr95151-3.c |  18 +++
 gcc/testsuite/gcc.target/i386/pr95151-4.c |  11 ++
 gcc/testsuite/gcc.target/i386/pr95443-1.c | 130 ++
 gcc/testsuite/gcc.target/i386/pr95443-2.c |  79 +
 9 files changed, 371 insertions(+), 59 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-1.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-2.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-3.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-4.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95443-1.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95443-2.c

-- 
2.26.2



[PATCH 2/2] x86: Add cmpmemsi for -minline-all-stringops

2020-05-31 Thread H.J. Lu via Gcc-patches
We used to expand memcmp to "repz cmpsb" via cmpstrnsi.  It was changed
by

commit 9b0f6f5e511ca512e4faeabc81d2fd3abad9b02f
Author: Nick Clifton 
Date:   Fri Aug 12 16:26:11 2011 +

builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi pattern.

* builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi
pattern.
* doc/md.texi (cmpstrn): Note that the comparison stops if both
fetched bytes are zero.
(cmpstr): Likewise.
(cmpmem): Note that the comparison does not stop if both of the
fetched bytes are zero.

Duplicate the cmpstrn pattern for cmpmem and expand cmpmem to "repz cmpsb"
for -minline-all-stringops.  The only difference is that the length
argument of cmpmem is guaranteed to be less than or equal to lengths of
2 memory areas.

gcc/

PR target/95151
* config/i386/i386-expand.c (ix86_expand_cmpstrn_or_cmpmem): New
function.
* config/i386/i386-protos.h (ix86_expand_cmpstrn_or_cmpmem): New
prototype.
* config/i386/i386.md (cmpmemsi): New pattern.

gcc/testsuite/

PR target/95151
* gcc.target/i386/pr95151-1.c: New test.
* gcc.target/i386/pr95151-2.c: Likewise.
* gcc.target/i386/pr95151-3.c: Likewise.
* gcc.target/i386/pr95151-4.c: Likewise.
---
 gcc/config/i386/i386-expand.c | 84 +++
 gcc/config/i386/i386-protos.h |  1 +
 gcc/config/i386/i386.md   | 84 ++-
 gcc/testsuite/gcc.target/i386/pr95151-1.c | 17 +
 gcc/testsuite/gcc.target/i386/pr95151-2.c | 10 +++
 gcc/testsuite/gcc.target/i386/pr95151-3.c | 18 +
 gcc/testsuite/gcc.target/i386/pr95151-4.c | 11 +++
 7 files changed, 162 insertions(+), 63 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-1.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-2.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-3.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95151-4.c

diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 270585decb2..9e27564037b 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -7656,6 +7656,90 @@ ix86_expand_set_or_cpymem (rtx dst, rtx src, rtx 
count_exp, rtx val_exp,
   return true;
 }
 
+/* Expand cmpstrn or memcmp.  */
+
+bool
+ix86_expand_cmpstrn_or_cmpmem (rtx result, rtx src1, rtx src2,
+  rtx length, rtx align, bool is_cmpstrn)
+{
+  if (optimize_insn_for_size_p () && !TARGET_INLINE_ALL_STRINGOPS)
+return false;
+
+  /* Can't use this if the user has appropriated ecx, esi or edi.  */
+  if (fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])
+return false;
+
+  if (is_cmpstrn)
+{
+  /* For strncmp, length is the maximum length, which can be larger
+than actual string lengths.  We can expand the cmpstrn pattern
+to "repz cmpsb" only if one of the strings is a constant so
+that expand_builtin_strncmp() can write the length argument to
+be the minimum of the const string length and the actual length
+argument.  Otherwise, "repz cmpsb" may pass the 0 byte.  */
+  tree t1 = MEM_EXPR (src1);
+  tree t2 = MEM_EXPR (src2);
+  if (!((t1 && TREE_CODE (t1) == MEM_REF
+&& TREE_CODE (TREE_OPERAND (t1, 0)) == ADDR_EXPR
+&& (TREE_CODE (TREE_OPERAND (TREE_OPERAND (t1, 0), 0))
+== STRING_CST))
+   || (t2 && TREE_CODE (t2) == MEM_REF
+   && TREE_CODE (TREE_OPERAND (t2, 0)) == ADDR_EXPR
+   && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (t2, 0), 0))
+   == STRING_CST
+   return false;
+}
+  else
+{
+  /* Expand memcmp to "repz cmpsb" only for -minline-all-stringops
+since "repz cmpsb" can be much slower than memcmp function
+implemented with vector instructions, see
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
+   */
+  if (!TARGET_INLINE_ALL_STRINGOPS)
+   return false;
+}
+
+  rtx addr1 = copy_addr_to_reg (XEXP (src1, 0));
+  rtx addr2 = copy_addr_to_reg (XEXP (src2, 0));
+  if (addr1 != XEXP (src1, 0))
+src1 = replace_equiv_address_nv (src1, addr1);
+  if (addr2 != XEXP (src2, 0))
+src2 = replace_equiv_address_nv (src2, addr2);
+
+  /* NB: Make a copy of the data length to avoid changing the original
+ data length by cmpstrnqi patterns.  */
+  length = ix86_zero_extend_to_Pmode (length);
+  rtx lengthreg = gen_reg_rtx (Pmode);
+  emit_move_insn (lengthreg, length);
+
+  /* If we are testing strict equality, we can use known alignment to
+ good advantage.  This may be possible with combine, particularly
+ once cc0 is dead.  */
+  if (CONST_INT_P (length))
+{
+  if (length == const0_rtx)
+   {
+ emit_move_insn (result, const0_rtx);
+ return true;
+   }
+  emit_insn 

[PATCH 1/2] x86: Pass a copy of the string length to cmpstrnqi

2020-05-31 Thread H.J. Lu via Gcc-patches
cmpstrnsi expander may pass the actual string length directly to cmpstrnqi
patterns.  For cmpstrnsi, one of the strings must be a constant and
expand_builtin_strncmp rewrites the length argument to be the minimum of
the const string length and the actual string length.  But it is not the
case for cmpmemsi.  Pass a copy of the string length to cmpstrnqi patterns
to avoid changing the actual string length by cmpstrnqi patterns.

gcc/

PR target/95443
* config/i386/i386.md (cmpstrnsi): Pass a copy of the string
length to cmpstrnqi patterns.

gcc/testsuite/

PR target/95443
* gcc.target/i386/pr95443-1.c: New test.
* gcc.target/i386/pr95443-2.c: Likewise.
---
 gcc/config/i386/i386.md   |   6 +-
 gcc/testsuite/gcc.target/i386/pr95443-1.c | 130 ++
 gcc/testsuite/gcc.target/i386/pr95443-2.c |  79 +
 3 files changed, 214 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95443-1.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95443-2.c

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 459cf62b0de..c2de1bdaf42 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -17816,7 +17816,11 @@ (define_expand "cmpstrnsi"
   if (addr2 != XEXP (operands[2], 0))
 operands[2] = replace_equiv_address_nv (operands[2], addr2);
 
-  countreg = ix86_zero_extend_to_Pmode (operands[3]);
+  /* NB: Make a copy of the data length to avoid changing the original
+ data length by cmpstrnqi patterns.  */
+  rtx count = ix86_zero_extend_to_Pmode (operands[3]);
+  countreg = gen_reg_rtx (Pmode);
+  emit_move_insn (countreg, count);
 
   /* %%% Iff we are testing strict equality, we can use known alignment
  to good advantage.  This may be possible with combine, particularly
diff --git a/gcc/testsuite/gcc.target/i386/pr95443-1.c 
b/gcc/testsuite/gcc.target/i386/pr95443-1.c
new file mode 100644
index 000..292ff16afdd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95443-1.c
@@ -0,0 +1,130 @@
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2 -minline-all-stringops" } */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+uint8_t shift[256];
+
+static size_t
+__attribute__ ((noclone, noinline))
+hash2(const unsigned char *p)
+{
+  return (((size_t)(p)[0] - ((size_t)(p)[-1] << 3)) % sizeof (shift));
+}
+
+char *
+simple_strstr (const char *haystack, const char *needle)
+{
+  const unsigned char *hs = (const unsigned char *) haystack;
+  const unsigned char *ne = (const unsigned char *) needle;
+  size_t ne_len = strlen ((const char*)ne);
+  size_t hs_len = strnlen ((const char*)hs, ne_len | 512);
+
+  if (hs_len < ne_len)
+return NULL;
+
+  if (memcmp (hs, ne, ne_len) == 0)
+return (char *) hs;
+
+  const unsigned char *end = hs + hs_len - ne_len;
+  size_t tmp, shift1;
+  size_t m1 = ne_len - 1;
+  size_t offset = 0;
+
+  memset (shift, 0, sizeof (shift));
+  for (int i = 1; i < m1; i++)
+shift[hash2 (ne + i)] = i;
+  shift1 = m1 - shift[hash2 (ne + m1)];
+  shift[hash2 (ne + m1)] = m1;
+
+  while (1)
+{
+  if (__glibc_unlikely (hs > end))
+   {
+ end += strnlen ((const char*)end + m1 + 1, 2048);
+ if (hs > end)
+   return NULL;
+   }
+
+  do
+   {
+ hs += m1;
+ tmp = shift[hash2 (hs)];
+   }
+  while (tmp == 0 && hs <= end);
+
+  hs -= tmp;
+  if (tmp < m1)
+   continue;
+
+  if (m1 < 15 || memcmp (hs + offset, ne + offset, 8) == 0)
+   {
+ if (memcmp (hs, ne, m1) == 0)
+   return (void *) hs;
+
+ offset = (offset >= 8 ? offset : m1) - 8;
+   }
+
+  hs += shift1;
+}
+}
+
+static int
+check_result (const char *s1, const char *s2,
+ char *exp_result)
+{
+  char *result = simple_strstr (s1, s2);
+  if (result != exp_result)
+return -1;
+
+  return 0;
+}
+
+void
+__attribute__ ((noclone, noinline))
+check1 (void)
+{
+  const char s1[] =
+
"F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
+  const char s2[] = "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
+  char *exp_result;
+
+  exp_result = simple_strstr (s1, s2);
+  if (check_result (s1, s2, exp_result) != 0)
+abort ();
+}
+
+int
+main (void)
+{
+  unsigned char *buf1, *buf2;
+  size_t page_size = 2 * sysconf(_SC_PAGESIZE);
+  buf1 = mmap (0, (1 + 1) * page_size, PROT_READ | PROT_WRITE,
+  MAP_PRIVATE | MAP_ANON, -1, 0);
+  if (buf1 == MAP_FAILED)
+return -1;
+  if (mprotect (buf1 + 1 * page_size, page_size, PROT_NONE))
+return -1;
+  buf2 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE,
+  MAP_PRIVATE | MAP_ANON, -1, 0);
+  if (buf2 == MAP_FAILED)
+return -1;
+  if (mprotect (buf2 + page_size, page_size, PROT_NONE))
+return -1;
+
+ 

[PATCH] Fix unrecognised -mcpu target: armv7-a on arm-wrs-vxworks7 (PR95420)

2020-05-31 Thread Iain Buclaw via Gcc-patches
Hi,

In the removal of arm-wrs-vxworks, the default cpu was updated from arm8
to armv7-a, but this is not recognized as a valid -mcpu target.  There
is however generic-armv7-a, which was likely the intended cpu that
should have been used instead.

Tested by building a cross-compiler targetting arm-wrs-vxworks7, running
make all-gcc and ensuring it succeeds.

OK?  This affects release/gcc-10 branch as well, so should be
backported too.

Regards
Iain.


gcc/ChangeLog:

PR target/95420
* config.gcc (arm-wrs-vxworks7*): Set default cpu to generic-armv7-a.
---
 gcc/config.gcc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index f544932fc39..06ad813ad39 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1193,7 +1193,7 @@ arm-wrs-vxworks7*)
tmake_file="${tmake_file} arm/t-arm arm/t-vxworks arm/t-bpabi"
tm_file="elfos.h arm/elf.h arm/bpabi.h arm/aout.h ${tm_file}"
tm_file="${tm_file} vx-common.h vxworks.h arm/vxworks.h"
-   target_cpu_cname="armv7-a"
+   target_cpu_cname="generic-armv7-a"
need_64bit_hwint=yes
;;
 arm*-*-freebsd*)# ARM FreeBSD EABI
-- 
2.20.1



[committed] wwwdocs: Simplify language in gitwrite.html.

2020-05-31 Thread Gerald Pfeifer
I noticed we have a tendency of using overly long language in
our process documentation.  This is a first step a simplifying
(and trimming).

Pushed.

Gerald

---
 htdocs/gitwrite.html | 24 ++--
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/htdocs/gitwrite.html b/htdocs/gitwrite.html
index e5dccd8e..36bb1a20 100644
--- a/htdocs/gitwrite.html
+++ b/htdocs/gitwrite.html
@@ -39,12 +39,11 @@ is not sufficient).
 If you already have an account on sourceware.org / gcc.gnu.org, ask
 overse...@gcc.gnu.org to add access to the GCC repository.
 Include the name of your sponsor and CC: her.
-If you do not have an account yet, use https://sourceware.org/cgi-bin/pdw/ps_form.cgi;>this form,
 again specifying your sponsor.
 
-We will then provision you on  
-gcc.gnu.org and inform you by mail. At this point,
+We will then provision you and inform you by mail. At this point,
 check out a tree using the instructions below and add yourself
 to the MAINTAINERS file.  Note: Your first and last names must
 be exactly the same between your account on gcc.gnu.org and the
@@ -61,8 +60,7 @@ access policies below.
 
 Setting up your local Git tree
 
-Once your account has been set up, check out the GCC sources by 
-issuing the command:
+Check out the GCC sources by issuing the command:
 
 
 git clone git+ssh://username@gcc.gnu.org/git/gcc.git gcc
@@ -99,7 +97,7 @@ git config --global user.email "Your Email Address"
 
 If you wish to use a different name or email address for GCC
 commits from that in $HOME/.gitconfig, you can configure
-that in an individual Git tree using a similar command
+that in an individual Git tree using similar invocations
 without --global.
 
 
@@ -241,16 +239,15 @@ automatically added to the corresponding ChangeLog files 
based
 on the git commit message.  See the documentation of
 ChangeLog format.
 
-Make sure to rebuild any generated files that would be affected by
-the patch.  Make sure to check them in along with the files explicitly
-modified by the patch.
+Make sure to rebuild any generated files affected by
+the patch and commit them with the files explicitly modified.
 
 If the patch adds any new files, such as testcases, use git
 add to make Git aware of them.
 
 We recommend using "git diff HEAD" after applying a
 patch to a local tree.  Review the output to make sure that only the
-changes you wanted to check in will be checked in.  Also check to see
+changes you want will be checked in.  Also see
 if the copyright dates need to be updated.
 
 Use "git commit" to check in the patch; either name
@@ -317,7 +314,7 @@ other developers, you can use git push as 
follows:
 git push origin $BRANCH:devel/$BRANCH
 
 
-Also, please document such branches at the
+Please document such branches at the
 list of development branches.
 
 
@@ -450,9 +447,8 @@ much the same way as C function names are used).
 
 contrib/git-fetch-vendor.sh
 
-Vendor spaces are controlled by the named vendor.  Unless you are
-affiliated with that vendor, do not push changes to that space without
-their express permission.
+Vendor spaces are controlled by the named vendor.  Do not push
+changes to that space without their express permission.
 
 This script will set up a new 'remote' that can be used to access
 the area used by a named vendor.  You need to
-- 
2.26.2


Re: [PATCH] diagnostics: Add function call parens matching to c_parser.

2020-05-31 Thread Mark Wielaard
On Sun, May 24, 2020 at 11:46:34PM +0200, Mark Wielaard wrote:
> The C++ parser already tracks function call parens matching, but the C
> parser doesn't. This adds the same functionality to the C parser and adds
> a testcase showing the C++ and C parser matching function call parens
> in an error message.
> 
> gcc/c/ChangeLog:
> 
>   * c-parser.c (c_parser_postfix_expression_after_primary): Add
>   scope with matching_parens after CPP_OPEN_PAREN.
> 
> gcc/testsuite/ChangeLog:
> 
>   * c-c++-common/missing-close-func-paren.c: New test.

Ping.

> ---
>  gcc/c/c-parser.c  | 32 ---
>  .../c-c++-common/missing-close-func-paren.c   | 40 +++
>  2 files changed, 57 insertions(+), 15 deletions(-)
>  create mode 100644 gcc/testsuite/c-c++-common/missing-close-func-paren.c
> 
> diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
> index 5d11e7e73c16..23d6fa22b685 100644
> --- a/gcc/c/c-parser.c
> +++ b/gcc/c/c-parser.c
> @@ -10458,21 +10458,23 @@ c_parser_postfix_expression_after_primary (c_parser 
> *parser,
> break;
>   case CPP_OPEN_PAREN:
> /* Function call.  */
> -   c_parser_consume_token (parser);
> -   for (i = 0; i < 3; i++)
> - {
> -   sizeof_arg[i] = NULL_TREE;
> -   sizeof_arg_loc[i] = UNKNOWN_LOCATION;
> - }
> -   literal_zero_mask = 0;
> -   if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN))
> - exprlist = NULL;
> -   else
> - exprlist = c_parser_expr_list (parser, true, false, ,
> -sizeof_arg_loc, sizeof_arg,
> -_loc, _zero_mask);
> -   c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
> -  "expected %<)%>");
> +   {
> + matching_parens parens;
> + parens.consume_open (parser);
> + for (i = 0; i < 3; i++)
> +   {
> + sizeof_arg[i] = NULL_TREE;
> + sizeof_arg_loc[i] = UNKNOWN_LOCATION;
> +   }
> + literal_zero_mask = 0;
> + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN))
> +   exprlist = NULL;
> + else
> +   exprlist = c_parser_expr_list (parser, true, false, ,
> +  sizeof_arg_loc, sizeof_arg,
> +  _loc, _zero_mask);
> + parens.skip_until_found_close (parser);
> +   }
> orig_expr = expr;
> mark_exp_read (expr.value);
> if (warn_sizeof_pointer_memaccess)
> diff --git a/gcc/testsuite/c-c++-common/missing-close-func-paren.c 
> b/gcc/testsuite/c-c++-common/missing-close-func-paren.c
> new file mode 100644
> index ..3177e250e1c3
> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/missing-close-func-paren.c
> @@ -0,0 +1,40 @@
> +/* { dg-options "-fdiagnostics-show-caret" } */
> +
> +/* Verify that the C/C++ frontends show the pertinent opening symbol when
> +   a closing symbol is missing for a function call.  */
> +
> +/* Verify that, when they are on the same line, that the opening symbol is
> +   shown as a secondary range within the main diagnostic.  */
> +
> +extern int __attribute__((const)) foo (int a, int b, int c);
> +
> +void single_func ()
> +{
> +  int single =
> +foo (1, (1 + 2), (1 + 2 + 3):); /* { dg-error "expected '\\)' before ':' 
> token" } */
> +  /* { dg-begin-multiline-output "" }
> + foo (1, (1 + 2), (1 + 2 + 3):);
> + ~   ^
> + )
> + { dg-end-multiline-output "" } */
> +}
> +
> +/* Verify that, when they are on different lines, that the opening symbol is
> +   shown via a secondary diagnostic.  */
> +
> +void multi_func ()
> +{
> +  int multi =
> +foo (1, /* { dg-message "to match this '\\('" } */
> + (1 + 2),
> + (1 + 2 + 3):); /* { dg-error "expected '\\)' before ':' token" } */
> +  /* { dg-begin-multiline-output "" }
> +  (1 + 2 + 3):);
> + ^
> + )
> + { dg-end-multiline-output "" } */
> +  /* { dg-begin-multiline-output "" }
> + foo (1,
> + ^
> + { dg-end-multiline-output "" } */
> +}
> -- 
> 2.20.1
> 


Re: [PATCH 4/6] contrib: Add or1k-elf, or1k-linux-*, and or1k-rtems to config-list.mk

2020-05-31 Thread Iain Buclaw via Gcc-patches
On 31/05/2020 22:53, Stafford Horne wrote:
> On Sun, May 31, 2020 at 12:19:16PM +0200, Iain Buclaw wrote:
>> Support for OpenRISC target was added in SVN r265963.
>>
>> The target configurations were taken from the list of supported
>> toolchains[1], so seems sensible to include them all.
>>
>> OK?
>>
>> Regards
>> Iain
>>
>> [1]: https://www.openrisc.io/software
>>
>> ---
>> contrib/ChangeLog:
>>
>>  * config-list.mk (LIST): Add or1k-elf, or1k-linux-*, and or1k-rtems.
> 
> This looks good to me.  Can you apply it or do you want me to do it?
> 
> -Stafford
> 

I've applied it.

Iain.


Re: [PATCH 4/6] contrib: Add or1k-elf, or1k-linux-*, and or1k-rtems to config-list.mk

2020-05-31 Thread Stafford Horne via Gcc-patches
On Sun, May 31, 2020 at 12:19:16PM +0200, Iain Buclaw wrote:
> Support for OpenRISC target was added in SVN r265963.
> 
> The target configurations were taken from the list of supported
> toolchains[1], so seems sensible to include them all.
> 
> OK?
> 
> Regards
> Iain
> 
> [1]: https://www.openrisc.io/software
> 
> ---
> contrib/ChangeLog:
> 
>   * config-list.mk (LIST): Add or1k-elf, or1k-linux-*, and or1k-rtems.

This looks good to me.  Can you apply it or do you want me to do it?

-Stafford


[pushed] coroutines: Avoid functions with unlowered coroutine trees [PR95087].

2020-05-31 Thread Iain Sandoe
Hi,

Diagnosing bad uses of 'return' in coroutines is somewhat
tricky, since the user can use the keyword before we know
that the function is a coroutine (where such returns are not
permitted).  At present, we are just doing a check for any
use of 'return' and erroring on that.  However, we can't then
pass the function body on, since it will contain unlowered
coroutine trees.

This avoids the issue by dropping the entire function body
under that circumstance.  We could do better (for 11) but
this is intended to allow back-port of other fixes to 10.

tested on x86_64-darwin, linux / powerpc64-linux
pushed to master as obvious,
thanks
Iain

gcc/cp/ChangeLog:

PR c++/95087
* coroutines.cc (morph_fn_to_coro): If we see an
early fatal error, drop the erroneous function body.

gcc/testsuite/ChangeLog:

PR c++/95087
* g++.dg/coroutines/co-return-syntax-08-bad-return.C:
Adjust the testcase to do the compile (rather than an
-fsyntax-only parse).
---
 gcc/cp/coroutines.cc   | 3 +++
 .../g++.dg/coroutines/co-return-syntax-08-bad-return.C | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index f3cf242b4f1..0abc579e0cb 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -3585,6 +3585,9 @@ morph_fn_to_coro (tree orig, tree *resumer, tree 
*destroyer)
 ramp return value, since the user cannot fix this - a 'return' is
 not allowed in a coroutine.  */
   TREE_NO_WARNING (orig) = true;
+  /* Discard the body, we can't process it further.  */
+  pop_stmt_list (DECL_SAVED_TREE (orig));
+  DECL_SAVED_TREE (orig) = push_stmt_list ();
   return false;
 }
 
diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C 
b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
index 4bfa41cd4a9..9b537548791 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
@@ -1,4 +1,4 @@
-//  { dg-additional-options "-fsyntax-only -w" }
+//  { dg-additional-options "-w" }
 
 #include "coro.h"
 
-- 
2.24.1



[pushed] coroutines: Remove up some unused values.

2020-05-31 Thread Iain Sandoe
Hi,

The build_new_method_call allows us to inspect the function decl used.
In most cases, this is not used and effectively is a set but not used value.
We can just set the parm to NULL.

tested on x86_64-darwin, linux, powerpc64-linux
pushed to master,
thanks
Iain

gcc/cp/ChangeLog:

* coroutines.cc (build_co_await): Remove unused variable.
(finish_co_await_expr): Likewise.
(finish_co_yield_expr): Likewise; revise comment.
---
 gcc/cp/coroutines.cc | 28 +---
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index c4df488ac02..f3cf242b4f1 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -696,9 +696,8 @@ build_co_await (location_t loc, tree a, suspend_point_kind 
suspend_kind)
   tree o;
   if (MAYBE_CLASS_TYPE_P (TREE_TYPE (a)))
 {
-  tree overload = NULL_TREE;
   o = build_new_op (loc, CO_AWAIT_EXPR, LOOKUP_NORMAL, a, NULL_TREE,
-   NULL_TREE, , tf_warning_or_error);
+   NULL_TREE, NULL, tf_warning_or_error);
   /* If no viable functions are found, o is a.  */
   if (!o || o == error_mark_node)
o = a;
@@ -873,19 +872,18 @@ finish_co_await_expr (location_t kw, tree expr)
   if (at_meth)
 {
   /* try to build a = p.await_transform (e). */
-  tree at_fn = NULL_TREE;
   vec *args = make_tree_vector_single (expr);
   a = build_new_method_call (get_coroutine_promise_proxy (
   current_function_decl),
 at_meth, , NULL_TREE, LOOKUP_NORMAL,
-_fn, tf_warning_or_error);
+NULL, tf_warning_or_error);
 
   /* As I read the section.
 We saw an await_transform method, so it's mandatory that we replace
 expr with p.await_transform (expr), therefore if the method call fails
 (presumably, we don't have suitable arguments) then this part of the
 process fails.  */
-  if (!at_fn || a == error_mark_node)
+  if (a == error_mark_node)
return error_mark_node;
 }
 
@@ -945,19 +943,19 @@ finish_co_yield_expr (location_t kw, tree expr)
   if (!y_meth || y_meth == error_mark_node)
 return error_mark_node;
 
-  tree yield_fn = NULL_TREE;
+  /* [expr.yield] / 1
+ Let e be the operand of the yield-expression and p be an lvalue naming
+ the promise object of the enclosing coroutine, then the yield-expression
+ is equivalent to the expression co_await p.yield_value(e).
+ build p.yield_value(e):  */
   vec *args = make_tree_vector_single (expr);
-  tree yield_call = build_new_method_call (
-get_coroutine_promise_proxy (current_function_decl), y_meth, ,
-NULL_TREE, LOOKUP_NORMAL, _fn, tf_warning_or_error);
-
-  if (!yield_fn || yield_call == error_mark_node)
-return error_mark_node;
+  tree yield_call = build_new_method_call
+(get_coroutine_promise_proxy (current_function_decl), y_meth, ,
+ NULL_TREE, LOOKUP_NORMAL, NULL, tf_warning_or_error);
 
-  /* So now we have the type of p.yield_value (e).
- Now we want to build co_await p.yield_value (e).
+  /* Now build co_await p.yield_value (e).
  Noting that for co_yield, there is no evaluation of any potential
- promise transform_await().  */
+ promise transform_await(), so we call build_co_await directly.  */
 
   tree op = build_co_await (kw, yield_call, CO_YIELD_SUSPEND_POINT);
   if (op != error_mark_node)
-- 
2.24.1



Fwd: [patch] substitute_and_fold_engine merge with evrp domwalker

2020-05-31 Thread Aldy Hernandez via Gcc-patches
PING

-- Forwarded message -
From: Aldy Hernandez 
Date: Mon, May 18, 2020 at 7:59 PM
Subject: [patch] substitute_and_fold_engine merge with evrp domwalker
To: Jeff Law 
Cc: gcc-patches 


Howdy.

The main evrp domwalker seems cut and pasted from the
substitute_and_fold_engine (or was it the other way around?).   Albeit,
there are a few things that evrp does, like set up ranges, but these can
be set up with virtuals, and thus provide a general repository to do all
things subst & fold, which I think was the main idea.

You will notice that the resulting evrp code becomes a handful of lines
calling evrp_analyze to set up ranges.

We've been playing with this approach on the ranger branch, and have
been able to use it to implement ranger-vrp in 24 lines, all while
sharing all the evrp folding code.  Granted, the ranger also needs
access to vr_values::simplify_using_ranges* which I have abstracted into
an independent class and will post as a follow-up.

Also, for future-proofing, I have added a gimple statement argument to
get_value().  This provides context where a future ranger (evrp, VRP,
ranger, whatever) can provide better values depending on the statement
we are processing.

OK for mainline?

Aldy
commit f90d4a08986e98cbcb827665d91759488c714075
Author: Aldy Hernandez 
Date:   Tue May 5 13:45:39 2020 +0200

Merge evrp uses of substitute_and_fold_engine into the engine itself.

This patch merges the evrp uses of the substitute and fold engine into
the engine itself, at least the parts that can be re-used by other
engine uses.  It also adds a context parameter to get_value() for
further use.

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 51b5b6c908d..19e2509ab0e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,37 @@
+2020-05-18  Aldy Hernandez  
+
+	* gimple-loop-versioning.cc (loop_versioning::name_prop::get_value):
+	Add stmt parameter.
+	* gimple-ssa-evrp.c (class evrp_folder): New.
+	(class evrp_dom_walker): Remove.
+	(execute_early_vrp): Use evrp_folder instead of evrp_dom_walker.
+	* tree-ssa-ccp.c (ccp_folder::get_value): Add stmt parameter.
+	* tree-ssa-copy.c (copy_folder::get_value): Same.
+	* tree-ssa-propagate.c (substitute_and_fold_engine::replace_uses_in):
+	Pass stmt to get_value.
+	(substitute_and_fold_engine::replace_phi_args_in): Same.
+	(substitute_and_fold_dom_walker::after_dom_children): Call
+	post_fold_bb.
+	(substitute_and_fold_dom_walker::foreach_new_stmt_in_bb): New.
+	(substitute_and_fold_dom_walker::propagate_into_phi_args): New.
+	(substitute_and_fold_dom_walker::before_dom_children): Adjust to
+	call virtual functions for folding, pre_folding, and post folding.
+	Call get_value with PHI.  Tweak dump.
+	* tree-ssa-propagate.h (class substitute_and_fold_engine):
+	New argument to get_value.
+	New virtual function pre_fold_bb.
+	New virtual function post_fold_bb.
+	New virtual function pre_fold_stmt.
+	New virtual function post_new_stmt.
+	New function propagate_into_phi_args.
+	* tree-vrp.c (vrp_folder::get_value): Add stmt argument.
+	* vr-values.c (vr_values::extract_range_from_stmt): Adjust dump
+	output.
+	(vr_values::fold_cond): New.
+	(vr_values::simplify_cond_using_ranges_1): Call fold_cond.
+	* vr-values.h (class vr_values): Add
+	simplify_cond_using_ranges_when_edge_is_known.
+
 2020-05-18  Carl Love  
 
 	PR target/94833
diff --git a/gcc/gimple-loop-versioning.cc b/gcc/gimple-loop-versioning.cc
index ff6c561f9e2..002b2a68b96 100644
--- a/gcc/gimple-loop-versioning.cc
+++ b/gcc/gimple-loop-versioning.cc
@@ -277,7 +277,7 @@ private:
   {
   public:
 name_prop (loop_info ) : m_li (li) {}
-tree get_value (tree) FINAL OVERRIDE;
+tree get_value (tree, gimple *) FINAL OVERRIDE;
 
   private:
 /* Information about the versioning we've performed on the loop.  */
@@ -534,7 +534,8 @@ loop_versioning::lv_dom_walker::after_dom_children (basic_block bb)
Return the new value if so, otherwise return null.  */
 
 tree
-loop_versioning::name_prop::get_value (tree val)
+loop_versioning::name_prop::get_value (tree val,
+   gimple *stmt ATTRIBUTE_UNUSED)
 {
   if (TREE_CODE (val) == SSA_NAME
   && bitmap_bit_p (_li.unity_names, SSA_NAME_VERSION (val)))
diff --git a/gcc/gimple-ssa-evrp.c b/gcc/gimple-ssa-evrp.c
index 599e1459f00..af780fd0519 100644
--- a/gcc/gimple-ssa-evrp.c
+++ b/gcc/gimple-ssa-evrp.c
@@ -43,273 +43,68 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-ssa-evrp-analyze.h"
 
 class evrp_folder : public substitute_and_fold_engine
-{
- public:
-  tree get_value (tree) FINAL OVERRIDE;
-  evrp_folder (class vr_values *vr_values_) : vr_values (vr_values_) { }
-  bool simplify_stmt_using_ranges (gimple_stmt_iterator *gsi)
-{ return vr_values->simplify_stmt_using_ranges (gsi); }
-  class vr_values *vr_values;
-
- private:
-  DISABLE_COPY_AND_ASSIGN (evrp_folder);
-};
-
-tree
-evrp_folder::get_value (tree op)
-{
-  return vr_values->op_with_constant_singleton_value_range 

Re: [patch] move array bounds checking into its own file

2020-05-31 Thread Aldy Hernandez via Gcc-patches
On Sun, May 31, 2020 at 7:31 PM Jeff Law  wrote:
>
> On Mon, 2020-05-18 at 20:11 +0200, Aldy Hernandez wrote:
> > As a follow-up to the patch moving array bounds checking into its own
> > class, this moves the class into its own files.  As I've mentioned
> > previously, having it in tree-vrp just pollutes the file with unrelated
> > stuff.
> >
> > Jeff, I know you've mentioned you'd like to move the array bounds
> > checking to the path isolation pass at some point.  Would the current
> > approach work for you?  I'm ok, inasmuch as it's gone from tree-vrp.c,
> > the file is bloated enough as it is.
> Yes, this is fine.  There's nothing conceptually about the array bounds 
> checking
> that requires it to live in VRP -- it was a historical decision because 
> access to
> the IL after ASSERT_EXPR insertion gave better results.
>
> As you probably remember, it was your investigative work on moving the array
> bounds bits out of VRP with an eye towards isolating them and turning them 
> into
> trap that was a significant factor in kicking off the Ranger project years 
> ago.
>
> This might need minor edits to make sure you don't lose Martin's work from 
> May 18
> in check_mem_ref().

Thanks, and good catch.  I will re-test and push.

Aldy



Re: [committed] Fix latent bug due to peephole2 pass dropping REG_INC notes

2020-05-31 Thread Jeff Law via Gcc-patches
On Mon, 2020-06-01 at 02:28 +0900, Oleg Endo wrote:
> Hi Jeff,
> 
> On Sun, 2020-05-31 at 11:20 -0600, Jeff Law via Gcc-patches wrote:
> > The peephole2 pass makes some attempt to update various notes, but that
> > doesn't
> > include REG_INC notes.  While I could trivially fix this in the H8 port, I
> > wouldn't be terribly surprised if the lack of a REG_INC note could cause
> > problems
> > on other ports.  So I think it's best to fix in the peephole pass.
> > 
> > As it turns out we already have  a function (two copies even!) to scan an
> > insn
> > for auto-inc addressing modes and add an appropriate note.
> > 
> > This patch moves that code from reload & lra into rtlanal.c and calls it 
> > from
> > the
> > peephole pass.
> 
> I ran into this issue a while ago.
> See also config/sh/sh.c, function sh_check_add_incdec_notes.

> 
> Is it possible to somehow fold all that into a universal solution?
I think the only notable difference here is sh_check_add_incdec_notes verifies
there's no note on the INSN first.  I think if we added that check into the
generic code we could probably drop sh_check_add_incdec_notes.


Jeff



Re: [patch] move value_range_equiv class to own file

2020-05-31 Thread Jeff Law via Gcc-patches
On Mon, 2020-05-18 at 20:08 +0200, Aldy Hernandez wrote:
> We already moved the value_range class into its own class in the last 
> release.  I think it's time to move the value_range_equiv stuff into its 
> own class, as it's a distraction from the VRP code.
> 
> I've moved it to value-range-equiv.*, and gave it a semblance of order, 
> by putting the constructors and setters at the beginning, the dumpers at 
> the bottom, etc.
> 
> No functional changes.
> 
> OK for mainline?
OK.

Jeff



Re: [patch] move array bounds checking into its own file

2020-05-31 Thread Jeff Law via Gcc-patches
On Mon, 2020-05-18 at 20:11 +0200, Aldy Hernandez wrote:
> As a follow-up to the patch moving array bounds checking into its own 
> class, this moves the class into its own files.  As I've mentioned 
> previously, having it in tree-vrp just pollutes the file with unrelated 
> stuff.
> 
> Jeff, I know you've mentioned you'd like to move the array bounds 
> checking to the path isolation pass at some point.  Would the current 
> approach work for you?  I'm ok, inasmuch as it's gone from tree-vrp.c, 
> the file is bloated enough as it is.
Yes, this is fine.  There's nothing conceptually about the array bounds checking
that requires it to live in VRP -- it was a historical decision because access 
to
the IL after ASSERT_EXPR insertion gave better results.

As you probably remember, it was your investigative work on moving the array
bounds bits out of VRP with an eye towards isolating them and turning them into
trap that was a significant factor in kicking off the Ranger project years ago.

This might need minor edits to make sure you don't lose Martin's work from May 
18
in check_mem_ref().
Jeff



Re: [committed] Fix latent bug due to peephole2 pass dropping REG_INC notes

2020-05-31 Thread Oleg Endo
Hi Jeff,

On Sun, 2020-05-31 at 11:20 -0600, Jeff Law via Gcc-patches wrote:
> 
> The peephole2 pass makes some attempt to update various notes, but that 
> doesn't
> include REG_INC notes.  While I could trivially fix this in the H8 port, I
> wouldn't be terribly surprised if the lack of a REG_INC note could cause 
> problems
> on other ports.  So I think it's best to fix in the peephole pass.
> 
> As it turns out we already have  a function (two copies even!) to scan an insn
> for auto-inc addressing modes and add an appropriate note.
> 
> This patch moves that code from reload & lra into rtlanal.c and calls it from 
> the
> peephole pass.

I ran into this issue a while ago.
See also config/sh/sh.c, function sh_check_add_incdec_notes.

Is it possible to somehow fold all that into a universal solution?

Cheers,
Oleg



Re: [PATCH 5/6] contrib: Add v850e1-elf to config-list.mk

2020-05-31 Thread Jeff Law via Gcc-patches
On Sun, 2020-05-31 at 12:19 +0200, Iain Buclaw via Gcc-patches wrote:
> This comment was added in SVN r173410, v850e1-* was added to config.sub
> in SVN r174691i (around 2011).  So it should no longer apply.
> 
> OK?
> 
> Regards
> Iain
> 
> ---
> contrib/ChangeLog:
> 
>   * config-list.mk (LIST): Add v850e1-elf.
OK.  Though I doubt the additional build gives us any notable amount of
additional coverage.

jeff
> 



Re: [PATCH 4/6] contrib: Add or1k-elf, or1k-linux-*, and or1k-rtems to config-list.mk

2020-05-31 Thread Jeff Law via Gcc-patches
On Sun, 2020-05-31 at 12:19 +0200, Iain Buclaw via Gcc-patches wrote:
> Support for OpenRISC target was added in SVN r265963.
> 
> The target configurations were taken from the list of supported
> toolchains[1], so seems sensible to include them all.
> 
> OK?
> 
> Regards
> Iain
> 
> [1]: https://www.openrisc.io/software
> 
> ---
> contrib/ChangeLog:
> 
>   * config-list.mk (LIST): Add or1k-elf, or1k-linux-*, and or1k-rtems.
OK.
Jeff
> 



Re: [PATCH 1/6] contrib: Remove cris-linux and crisv32-* from config-list.mk

2020-05-31 Thread Jeff Law via Gcc-patches
On Sun, 2020-05-31 at 12:02 +0200, Iain Buclaw via Gcc-patches wrote:
> Hi,
> 
> Continuing from the previous update to config-list.mk, I realize that
> there are a few other more additions/removals to be done.
> 
> To start off, support for crisv32-*-* and cris-*-linux* was removed in
> git 2b36e4dc813/r11-214.
> 
> OK?
> 
> Regards
> Iain
> 
> ---
> contrib/ChangeLog:
> 
>   * config-list.mk (LIST): Remove cris-linux, crisv32-elf, and
>   crisv32-linux.
OK
jeff
> 



Re: [PATCH 2/6] contrib: Remove arm-wrs-vxworks from config-list.mk

2020-05-31 Thread Jeff Law via Gcc-patches
On Sun, 2020-05-31 at 12:15 +0200, Iain Buclaw via Gcc-patches wrote:
> Support for arm-wrs-vxworks was removed in git 27204060db5/r10-4684.
> 
> Looking at the commit, it seems that it can instead be replaced with
> arm-wrs-vxworks7, however this target doesn't pass selftests due to an
> unrecognized CPU (PR 95420).  Nor does the previous default CPU work
> either (arm-wrs-vxworks7OPT-with-cpu=arm8) as it requires the VSB_DIR
> environment variable to be set, even if -nostdinc is used (I think I see
> where the dependency is coming from though, so could submit another
> patch to plug that).
> 
> OK?
> 
> Regards
> Iain
> 
> ---
> contrib/ChangeLog:
> 
>   * config-list.mk (LIST): Remove arm-wrs-vxworks.
OK
jeff
> 



[committed] Fix latent bug due to peephole2 pass dropping REG_INC notes

2020-05-31 Thread Jeff Law via Gcc-patches

The H8 recently started regressing 20071219-1.c on the H8/SX with -mint32.  I
didn't really dig into what change caused the regression.  While I recently
changed this peephole, it was just collapsing 3 patterns into 1 using mode
iterators.  So more likely something earlier in the pipeline just changed things
enough to trigger this latent issue.



We have this peephole:

;; Convert a memory comparison to a move if there is a scratch register.

(define_peephole2
  [(match_scratch:QHSI 1 "r")
   (set (cc0)
(compare (match_operand:QHSI 0 "memory_operand" "")
 (const_int 0)))]
  ""
  [(set (match_dup 1)
(match_dup 0))
   (set (cc0) (compare (match_dup 1)
   (const_int 0)))]
  "")

So imagine if operand 0 has an embedded side effect.  We end up moving the
embedded side effect to a different insn but we end up losing our REG_INC note.

Later in reorg (yes, the H8/SX has delay slots, even though I think we rarely
fill them :(  we have this code:

>   /* If this insn is a register-register copy and the next insn has
>  a use of our destination, change it to use our source.  That way,
>  it will become a candidate for our delay slot the next time
>  through this loop.  This case occurs commonly in loops that
>  scan a list.
> 
>  We could check for more complex cases than those tested below,
>  but it doesn't seem worth it.  It might also be a good idea to try
>  to swap the two insns.  That might do better.
> 
>  We can't do this if the next insn modifies our destination, because
>  that would make the replacement into the insn invalid.  We also can't
>  do this if it modifies our source, because it might be an 
> earlyclobber
>  operand.  This latter test also prevents updating the contents of
>  a PRE_INC.  We also can't do this if there's overlap of source and
>  destination.  Overlap may happen for larger-than-register-size
> modes.  */
> 
>   if (NONJUMP_INSN_P (trial) && GET_CODE (pat) == SET
>   && REG_P (SET_SRC (pat))
>   && REG_P (SET_DEST (pat))
>   && !reg_overlap_mentioned_p (SET_DEST (pat), SET_SRC (pat)))
> {
>   rtx_insn *next = next_nonnote_insn (trial);
> 
>   if (next && NONJUMP_INSN_P (next)
>   && GET_CODE (PATTERN (next)) != USE
>   && ! reg_set_p (SET_DEST (pat), next)
>   && ! reg_set_p (SET_SRC (pat), next)
>   && reg_referenced_p (SET_DEST (pat), PATTERN (next))
>   && ! modified_in_p (SET_DEST (pat), next))
> validate_replace_rtx (SET_DEST (pat), SET_SRC (pat), next);
> }
> }
> 

With the REG_INC note missing (it would have been detected in the reg_set_p
calls) this code fires and makes an invalid change resulting in incorrect code
being generated.

The peephole2 pass makes some attempt to update various notes, but that doesn't
include REG_INC notes.  While I could trivially fix this in the H8 port, I
wouldn't be terribly surprised if the lack of a REG_INC note could cause 
problems
on other ports.  So I think it's best to fix in the peephole pass.

As it turns out we already have  a function (two copies even!) to scan an insn
for auto-inc addressing modes and add an appropriate note.

This patch moves that code from reload & lra into rtlanal.c and calls it from 
the
peephole pass.

Bootstrapped and regression tested on x86-64, ppc64, ppc64le and a nice variety
of embedded targets have built and regression tested.  It's also bootstrapped on
m68k using qemu within a chroot (testing is ongoing).  Other targets are in
progress.  The tester has been a bit unstable due to various unrelated trunk
issues, so I don't have quite the coverage that I'd normally have at this point
(arm and aarch64 in particular would be useful to have, but have been highly
unstable lately).


Committing to the trunk,

Jeff





commit c25d0fa4d76cbc46078624d101ac019ff3df1142
Author: Jeff Law 
Date:   Sun May 31 11:16:37 2020 -0600

Fix execute/20071219-1.c regression on H8 due to loss of REG_INC notes in 
peephole2.

gcc/
* lra.c (add_auto_inc_notes): Remove function.
* reload1.c (add_auto_inc_notes): Similarly.  Move into...
* rtlanal.c (add_auto_inc_notes): New function.
* rtl.h (add_auto_inc_notes): Add prototype.
* recog.c (peep2_attempt): Scan and add REG_INC notes to new insns
as needed.

diff --git a/gcc/lra.c b/gcc/lra.c
index 5e8b75b1fda..3435cff6a1d 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2231,34 +2231,6 @@ has_nonexceptional_receiver (void)
   return false;
 }
 
-
-/* Process recursively X of INSN and add REG_INC notes if necessary.  */
-static void
-add_auto_inc_notes (rtx_insn *insn, rtx x)
-{
-  enum rtx_code code = GET_CODE (x);
-  const char *fmt;
-  int i, j;
-
-  if (code == MEM && auto_inc_p (XEXP (x, 0)))
-{
-  

Cleanup indexable tree ref streaming

2020-05-31 Thread Jan Hubicka
Hi,
this patch removes some abstraction around streaming references which
makes it difficult to play with the format of actual streamed
references. They are alway spair of integers, one represents the tag
and other is index.  So I separated code computing them to common place
followed by the uhwi stores.

Boostrapped/regtested x86_64-linux, comitted.

2020-05-30  Jan Hubicka  

gcc/

* lto-section-out.c (lto_output_decl_index): Remove.
(lto_output_field_decl_index): Move to lto-streamer-out.c
(lto_output_fn_decl_index): Move to lto-streamer-out.c
(lto_output_namespace_decl_index): Remove.
(lto_output_var_decl_index): Remove.
(lto_output_type_decl_index): Remove.
(lto_output_type_ref_index): Remove.
* lto-streamer-out.c (output_type_ref): Remove.
(lto_get_index): New function.
(lto_output_tree_ref): Remove.
(lto_indexable_tree_ref): New function.
(lto_output_var_decl_index): Move here from lto-section-out.c; simplify.
(lto_output_fn_decl_index): Move here from lto-section-out.c; simplify.
(stream_write_tree_ref): Update.
(lto_output_tree): Update.
* lto-streamer.h (lto_output_decl_index): Remove prototype.
(lto_output_field_decl_index): Remove prototype.
(lto_output_namespace_decl_index): Remove prototype.
(lto_output_type_decl_index): Remove prototype.
(lto_output_type_ref_index): Remove prototype.
(lto_output_var_decl_index): Move.
(lto_output_fn_decl_index): Move

diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index db395624a16..fb1a9dc3fc5 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -484,7 +484,8 @@ get_unique_type_string (char *string, gfc_symbol *derived)
   if (derived->attr.unlimited_polymorphic)
 strcpy (dt_name, "STAR");
   else
-strncpy (dt_name, gfc_dt_upper_string (derived->name), sizeof (dt_name));
+strncpy (dt_name, gfc_dt_upper_string (derived->name),
+sizeof (dt_name) - 1);
   if (derived->attr.unlimited_polymorphic)
 sprintf (string, "_%s", dt_name);
   else if (derived->module)
diff --git a/gcc/lto-section-out.c b/gcc/lto-section-out.c
index 0182cd6059e..b546e8a2fe0 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -147,111 +147,6 @@ lto_write_stream (struct lto_output_stream *obs)
 }
 }
 
-
-/* Lookup NAME in ENCODER.  If NAME is not found, create a new entry in
-   ENCODER for NAME with the next available index of ENCODER,  then
-   print the index to OBS.  True is returned if NAME was added to
-   ENCODER.  The resulting index is stored in THIS_INDEX.
-
-   If OBS is NULL, the only action is to add NAME to the encoder. */
-
-bool
-lto_output_decl_index (struct lto_output_stream *obs,
-  struct lto_tree_ref_encoder *encoder,
-  tree name, unsigned int *this_index)
-{
-  bool new_entry_p = FALSE;
-  bool existed_p;
-
-  unsigned int 
-= encoder->tree_hash_table->get_or_insert (name, _p);
-  if (!existed_p)
-{
-  index = encoder->trees.length ();
-  if (streamer_dump_file)
-   {
- print_node_brief (streamer_dump_file, " Encoding indexable ",
-   name, 4);
- fprintf (streamer_dump_file, "  as %i \n", index);
-   }
-  encoder->trees.safe_push (name);
-  new_entry_p = TRUE;
-}
-
-  if (obs)
-streamer_write_uhwi_stream (obs, index);
-  *this_index = index;
-  return new_entry_p;
-}
-
-/* Output a field DECL to OBS.  */
-
-void
-lto_output_field_decl_index (struct lto_out_decl_state *decl_state,
-struct lto_output_stream * obs, tree decl)
-{
-  unsigned int index;
-  lto_output_decl_index (obs, _state->streams[LTO_DECL_STREAM_FIELD_DECL],
-decl, );
-}
-
-/* Output a function DECL to OBS.  */
-
-void
-lto_output_fn_decl_index (struct lto_out_decl_state *decl_state,
- struct lto_output_stream * obs, tree decl)
-{
-  unsigned int index;
-  lto_output_decl_index (obs, _state->streams[LTO_DECL_STREAM_FN_DECL],
-decl, );
-}
-
-/* Output a namespace DECL to OBS.  */
-
-void
-lto_output_namespace_decl_index (struct lto_out_decl_state *decl_state,
-struct lto_output_stream * obs, tree decl)
-{
-  unsigned int index;
-  lto_output_decl_index (obs,
-_state->streams[LTO_DECL_STREAM_NAMESPACE_DECL],
-decl, );
-}
-
-/* Output a static or extern var DECL to OBS.  */
-
-void
-lto_output_var_decl_index (struct lto_out_decl_state *decl_state,
-  struct lto_output_stream * obs, tree decl)
-{
-  unsigned int index;
-  lto_output_decl_index (obs, _state->streams[LTO_DECL_STREAM_VAR_DECL],
-decl, );
-}
-
-/* Output a type DECL to OBS.  */
-
-void
-lto_output_type_decl_index (struct lto_out_decl_state *decl_state,
-  

Re: [PATCH 3/6] contrib: Add pru-elf to config-list.mk

2020-05-31 Thread Dimitar Dimitrov
On неделя, 31 май 2020 г. 13:17:21 EEST Iain Buclaw wrote:
> Support for the TI PRU target was added in SVN r272202.
> 
> Judging from the testsuite results posted at the time[1], the only
> supported target is pru-elf.
> 
> OK?
> 
> Regards
> Iain.
> 
> [1]: http://dinux.eu/gnupru/testresults/index.html
> 
> ---
Thank you. I confirm that pru-elf is the only supported target.

My bot also posts daily to gcc-testresults [1].

Regards,
Dimitar

[1]  https://gcc.gnu.org/pipermail/gcc-testresults/2020-May/560070.html




[committed] wwwdocs: Update examples for branches and tags to newer ones.

2020-05-31 Thread Gerald Pfeifer
Pushed.

---
 htdocs/git.html | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/htdocs/git.html b/htdocs/git.html
index bec93ead..8c28bc02 100644
--- a/htdocs/git.html
+++ b/htdocs/git.html
@@ -146,12 +146,12 @@ series, Y is always nonzero and Z is 
always zero for
 a release, with other version numbers being used for development
 versions.)
 
-The following list provides some representative examples:
+The following are some representative examples:
 
 
+  releases/gcc-10 (a branch)
   releases/gcc-9 (a branch)
-  releases/gcc-8 (a branch)
-  releases/gcc-7.5.0 (a tag)
+  releases/gcc-9.3.0 (a tag)
   releases/gcc-4.9 (a branch)
   releases/gcc-4.9.0 (a tag)
 
-- 
2.26.2


[PATCH] tilepro: Update generator file to define IN_TARGET_CODE in target file.

2020-05-31 Thread Iain Buclaw via Gcc-patches
Hi,

The target files tilegx/mul-tables.c and tilepri/mul-tables.c were
updated in SVN r255743, but the generator file that produces them
wasn't, so it was reverting this change during builds.

Only tested by running make all-gcc for all tile*-*-* targets present in
config-list.mk.

OK?

Regards
Iain

---
gcc/ChangeLog:

* config/tilepro/gen-mul-tables.cc (main): Define IN_TARGET_CODE to 1
in the target file.
---
 gcc/config/tilepro/gen-mul-tables.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/tilepro/gen-mul-tables.cc 
b/gcc/config/tilepro/gen-mul-tables.cc
index 2a345023aea..7f9fb65dc2f 100644
--- a/gcc/config/tilepro/gen-mul-tables.cc
+++ b/gcc/config/tilepro/gen-mul-tables.cc
@@ -1252,6 +1252,8 @@ main ()
   printf ("/* Note this file is auto-generated from gen-mul-tables.cc.\n");
   printf ("   Make any required changes there.  */\n");
   printf ("\n");
+  printf ("#define IN_TARGET_CODE 1\n");
+  printf ("\n");
   printf ("#include \"config.h\"\n");
   printf ("#include \"system.h\"\n");
   printf ("#include \"coretypes.h\"\n");
-- 
2.20.1



[PATCH 6/6] contrib: Add OPT-enable-obsolete to tile*-*-*

2020-05-31 Thread Iain Buclaw via Gcc-patches
The tile*-*-* targets were marked as obsolete in SVN r259724.

OK?

Regards
Iain

---
contrib/ChangeLog:

* config-list.mk (LIST): Add OPT-enable-obsolete to tilegx-linux-gnu,
tilegxbe-linux-gnu, and tilepro-linux-gnu.
---
 contrib/config-list.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 5818f7df08b..8a4ce8aca25 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -93,7 +93,8 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   
sparc64-sun-solaris2.11OPT-with-gnu-ldOPT-with-gnu-asOPT-enable-threads=posix \
   sparc-wrs-vxworks sparc64-elf sparc64-rtems sparc64-linux sparc64-freebsd6 \
   sparc64-netbsd sparc64-openbsd \
-  tilegx-linux-gnu tilegxbe-linux-gnu tilepro-linux-gnu \
+  tilegx-linux-gnuOPT-enable-obsolete tilegxbe-linux-gnuOPT-enable-obsolete \
+  tilepro-linux-gnuOPT-enable-obsolete \
   v850e1-elf v850e-elf v850-elf v850-rtems vax-linux-gnu \
   vax-netbsdelf vax-openbsd visium-elf x86_64-apple-darwin \
   x86_64-pc-linux-gnuOPT-with-fpmath=avx \
-- 
2.20.1



[PATCH 5/6] contrib: Add v850e1-elf to config-list.mk

2020-05-31 Thread Iain Buclaw via Gcc-patches
This comment was added in SVN r173410, v850e1-* was added to config.sub
in SVN r174691i (around 2011).  So it should no longer apply.

OK?

Regards
Iain

---
contrib/ChangeLog:

* config-list.mk (LIST): Add v850e1-elf.
---
 contrib/config-list.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 6e4a8a8389e..5818f7df08b 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -29,7 +29,6 @@ GCC_SRC_DIR=../../gcc
 # > make.out 2>&1 &
 #
 
-# v850e1-elf is rejected by config.sub
 LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   alpha-linux-gnu alpha-netbsd alpha-openbsd \
   alpha64-dec-vms alpha-dec-vms \
@@ -95,7 +94,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   sparc-wrs-vxworks sparc64-elf sparc64-rtems sparc64-linux sparc64-freebsd6 \
   sparc64-netbsd sparc64-openbsd \
   tilegx-linux-gnu tilegxbe-linux-gnu tilepro-linux-gnu \
-  v850e-elf v850-elf v850-rtems vax-linux-gnu \
+  v850e1-elf v850e-elf v850-elf v850-rtems vax-linux-gnu \
   vax-netbsdelf vax-openbsd visium-elf x86_64-apple-darwin \
   x86_64-pc-linux-gnuOPT-with-fpmath=avx \
   x86_64-elfOPT-with-fpmath=sse x86_64-freebsd6 x86_64-netbsd \
-- 
2.20.1



[PATCH 4/6] contrib: Add or1k-elf, or1k-linux-*, and or1k-rtems to config-list.mk

2020-05-31 Thread Iain Buclaw via Gcc-patches
Support for OpenRISC target was added in SVN r265963.

The target configurations were taken from the list of supported
toolchains[1], so seems sensible to include them all.

OK?

Regards
Iain

[1]: https://www.openrisc.io/software

---
contrib/ChangeLog:

* config-list.mk (LIST): Add or1k-elf, or1k-linux-*, and or1k-rtems.
---
 contrib/config-list.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 2d8d16a5fe1..6e4a8a8389e 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -72,6 +72,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   nds32le-elf nds32be-elf \
   nios2-elf nios2-linux-gnu nios2-rtems \
   nvptx-none \
+  or1k-elf or1k-linux-uclibc or1k-linux-musl or1k-rtems \
   pdp11-aout \
   powerpc-darwin8 \
   powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
-- 
2.20.1



[PATCH 3/6] contrib: Add pru-elf to config-list.mk

2020-05-31 Thread Iain Buclaw via Gcc-patches
Support for the TI PRU target was added in SVN r272202.

Judging from the testsuite results posted at the time[1], the only
supported target is pru-elf.

OK?

Regards
Iain.

[1]: http://dinux.eu/gnupru/testresults/index.html

---
contrib/ChangeLog:

* config-list.mk (LIST): Add pru-elf.
---
 contrib/config-list.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index cd1d8f2f936..2d8d16a5fe1 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -82,6 +82,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   powerpc-wrs-vxworks powerpc-wrs-vxworksae powerpc-wrs-vxworksmils \
   powerpc-lynxos powerpcle-elf \
   powerpcle-eabisim powerpcle-eabi \
+  pru-elf \
   riscv32-unknown-linux-gnu riscv64-unknown-linux-gnu \
   rs6000-ibm-aix6.1 rs6000-ibm-aix7.1 \
   rl78-elf rx-elf s390-linux-gnu s390x-linux-gnu s390x-ibm-tpf sh-elf \
-- 
2.20.1



[PATCH 2/6] contrib: Remove arm-wrs-vxworks from config-list.mk

2020-05-31 Thread Iain Buclaw via Gcc-patches
Support for arm-wrs-vxworks was removed in git 27204060db5/r10-4684.

Looking at the commit, it seems that it can instead be replaced with
arm-wrs-vxworks7, however this target doesn't pass selftests due to an
unrecognized CPU (PR 95420).  Nor does the previous default CPU work
either (arm-wrs-vxworks7OPT-with-cpu=arm8) as it requires the VSB_DIR
environment variable to be set, even if -nostdinc is used (I think I see
where the dependency is coming from though, so could submit another
patch to plug that).

OK?

Regards
Iain

---
contrib/ChangeLog:

* config-list.mk (LIST): Remove arm-wrs-vxworks.
---
 contrib/config-list.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 05b6f925891..cd1d8f2f936 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -36,7 +36,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   amdgcn-amdhsa \
   arc-elf32OPT-with-cpu=arc600 arc-elf32OPT-with-cpu=arc700 \
   arc-linux-uclibcOPT-with-cpu=arc700 arceb-linux-uclibcOPT-with-cpu=arc700 \
-  arm-wrs-vxworks arm-netbsdelf \
+  arm-netbsdelf \
   arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \
   arm-symbianelf avr-elf \
   bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
-- 
2.20.1



[PATCH 1/6] contrib: Remove cris-linux and crisv32-* from config-list.mk

2020-05-31 Thread Iain Buclaw via Gcc-patches
Hi,

Continuing from the previous update to config-list.mk, I realize that
there are a few other more additions/removals to be done.

To start off, support for crisv32-*-* and cris-*-linux* was removed in
git 2b36e4dc813/r11-214.

OK?

Regards
Iain

---
contrib/ChangeLog:

* config-list.mk (LIST): Remove cris-linux, crisv32-elf, and
crisv32-linux.
---
 contrib/config-list.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index c1c2fd162b1..05b6f925891 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -41,7 +41,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
   arm-symbianelf avr-elf \
   bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
   bpf-unknown-none \
-  c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \
+  c6x-elf c6x-uclinux cr16-elf cris-elf \
   csky-elf csky-linux-gnu \
   epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \
   fr30-elf frv-elf frv-linux ft32-elf h8300-elf hppa-linux-gnu \
-- 
2.20.1