[gcc-7] 298/354: * Update to SVN 20170920 (r253002) from the gcc-7-branch.

Ximin Luo infinity0 at debian.org
Thu Nov 23 15:51:24 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository gcc-7.

commit 17bac5aa05b20c441e38d072ff314c47c38da85d
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Wed Sep 20 08:55:08 2017 +0000

      * Update to SVN 20170920 (r253002) from the gcc-7-branch.
    
    
    git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9702 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog                |    5 +
 debian/patches/svn-updates.diff | 1414 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 1366 insertions(+), 53 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5d8131b..6d099ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
 gcc-7 (7.2.0-6) UNRELEASED; urgency=medium
 
+  * Update to SVN 20170920 (r253002) from the gcc-7-branch.
+    - Fix PR target/82112 (PPC), PR c++/81355, PR tree-optimization/82084,
+      PR tree-optimization/82108, PR target/81325 (PPC), PR c++/81236,
+      PR c++/80767, PR c++/82030, PR c++/80935, PR c++/81671, PR c++/81525,
+      PR c++/81314, PR libgfortran/78387.
   * Fix fortran cross compiler build with debhelper 10.9. Closes: #876246.
 
  -- Matthias Klose <doko at debian.org>  Wed, 20 Sep 2017 09:53:55 +0200
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index 75642d8..fbfd694 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 7 branch upto 20170915 (r252791).
+# DP: updates from the 7 branch upto 20170920 (r253002).
 
 last_update()
 {
 	cat > ${dir}LAST_UPDATED <EOF
-Fri Sep 15 11:11:00 CEST 2017
-Fri Sep 15 09:11:00 UTC 2017 (revision 252791)
+Wed Sep 20 10:24:10 CEST 2017
+Wed Sep 20 08:24:10 UTC 2017 (revision 253002)
 EOF
 }
 
@@ -16,7 +16,15 @@ Index: libgomp/ChangeLog
 ===================================================================
 --- a/src/libgomp/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/libgomp/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,18 @@
+@@ -1,3 +1,26 @@
++2017-09-15  Jakub Jelinek  <jakub at redhat.com>
++
++	Backported from mainline
++	2017-09-14  Jakub Jelinek  <jakub at redhat.com>
++
++	PR c++/81314
++	* testsuite/libgomp.c++/pr81314.C: New test.
++
 +2017-09-07  Jakub Jelinek  <jakub at redhat.com>
 +
 +	Backported from mainline
@@ -35,6 +43,49 @@ Index: libgomp/ChangeLog
  2017-08-14  Release Manager
  
  	* GCC 7.2.0 released.
+Index: libgomp/testsuite/libgomp.c++/pr81314.C
+===================================================================
+--- a/src/libgomp/testsuite/libgomp.c++/pr81314.C	(.../tags/gcc_7_2_0_release)
++++ b/src/libgomp/testsuite/libgomp.c++/pr81314.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,38 @@
++// PR c++/81314
++// { dg-do link }
++
++template <int N>
++struct S {
++  S () { s = 0; }
++  S (const S &x) { s = x.s; }
++  ~S () {}
++  int s;
++};
++
++void
++foo (S<2> &x)
++{
++  #pragma omp taskloop
++  for (int i = 0; i < 100; ++i)
++    x.s++;
++}
++
++void
++bar (S<3> &x)
++{
++  #pragma omp task
++  x.s++;
++}
++
++int
++main ()
++{
++  S<2> s;
++  S<3> t;
++  #pragma omp parallel
++  #pragma omp master
++  {
++    foo (s);
++    bar (t);
++  }
++}
 Index: libgomp/testsuite/libgomp.c++/pr45784.C
 ===================================================================
 --- a/src/libgomp/testsuite/libgomp.c++/pr45784.C	(.../tags/gcc_7_2_0_release)
@@ -5313,7 +5364,19 @@ Index: gcc/c-family/ChangeLog
 ===================================================================
 --- a/src/gcc/c-family/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/c-family/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,37 @@
+@@ -1,3 +1,49 @@
++2017-09-15  Jakub Jelinek  <jakub at redhat.com>
++
++	Backported from mainline
++	2017-09-12  Jakub Jelinek  <jakub at redhat.com>
++
++	PR target/82112
++	* c-common.c (sync_resolve_size): Instead of c_dialect_cxx ()
++	assertion check that in the condition.
++	(get_atomic_generic_size): Likewise.  Before testing if parameter
++	has pointer type, if it has array type, call for C++
++	default_conversion to perform array-to-pointer conversion.
++
 +2017-09-15  Martin Liska  <mliska at suse.cz>
 +
 +	Backport from mainline
@@ -5364,6 +5427,43 @@ Index: gcc/c-family/c-common.c
  
    targetm.override_options_after_change();
  
+@@ -6576,10 +6576,9 @@
+     }
+ 
+   argtype = type = TREE_TYPE ((*params)[0]);
+-  if (TREE_CODE (type) == ARRAY_TYPE)
++  if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ())
+     {
+       /* Force array-to-pointer decay for C++.  */
+-      gcc_assert (c_dialect_cxx());
+       (*params)[0] = default_conversion ((*params)[0]);
+       type = TREE_TYPE ((*params)[0]);
+     }
+@@ -6741,10 +6740,9 @@
+ 
+   /* Get type of first parameter, and determine its size.  */
+   type_0 = TREE_TYPE ((*params)[0]);
+-  if (TREE_CODE (type_0) == ARRAY_TYPE)
++  if (TREE_CODE (type_0) == ARRAY_TYPE && c_dialect_cxx ())
+     {
+       /* Force array-to-pointer decay for C++.  */
+-      gcc_assert (c_dialect_cxx());
+       (*params)[0] = default_conversion ((*params)[0]);
+       type_0 = TREE_TYPE ((*params)[0]);
+     }
+@@ -6783,6 +6781,12 @@
+       /* __atomic_compare_exchange has a bool in the 4th position, skip it.  */
+       if (n_param == 6 && x == 3)
+         continue;
++      if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ())
++	{
++	  /* Force array-to-pointer decay for C++.  */
++	  (*params)[x] = default_conversion ((*params)[x]);
++	  type = TREE_TYPE ((*params)[x]);
++	}
+       if (!POINTER_TYPE_P (type))
+ 	{
+ 	  error_at (loc, "argument %d of %qE must be a pointer type", x + 1,
 Index: gcc/c-family/c-omp.c
 ===================================================================
 --- a/src/gcc/c-family/c-omp.c	(.../tags/gcc_7_2_0_release)
@@ -5438,33 +5538,13 @@ Index: gcc/c-family/c-attribs.c
      }
    else
      {
-@@ -3029,6 +3034,19 @@
- 						      flags))
-     *no_add_attrs = true;
- 
-+  /* Check that there's no empty string in values of the attribute.  */
-+  for (tree t = args; t != NULL_TREE; t = TREE_CHAIN (t))
-+    {
-+      tree value = TREE_VALUE (t);
-+      if (TREE_CODE (value) == STRING_CST
-+	  && TREE_STRING_LENGTH (value) == 1
-+	  && TREE_STRING_POINTER (value)[0] == '\0')
-+	{
-+	  warning (OPT_Wattributes, "empty string in attribute %<target%>");
-+	  *no_add_attrs = true;
-+	}
-+    }
-+
-   return NULL_TREE;
- }
- 
 Index: gcc/DATESTAMP
 ===================================================================
 --- a/src/gcc/DATESTAMP	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/DATESTAMP	(.../branches/gcc-7-branch)
 @@ -1 +1 @@
 -20170814
-+20170915
++20170920
 Index: gcc/tree.c
 ===================================================================
 --- a/src/gcc/tree.c	(.../tags/gcc_7_2_0_release)
@@ -5677,7 +5757,49 @@ Index: gcc/fold-const.c
        /* The last case is if we are a multiply.  In that case, we can
  	 apply the distributive law to commute the multiply and addition
  	 if the multiplication of the constants doesn't overflow
-@@ -8879,7 +8882,7 @@
+@@ -7200,15 +7203,10 @@
+ static int
+ native_encode_string (const_tree expr, unsigned char *ptr, int len, int off)
+ {
+-  tree type = TREE_TYPE (expr);
+-  HOST_WIDE_INT total_bytes;
++  if (! can_native_encode_string_p (expr))
++    return 0;
+ 
+-  if (TREE_CODE (type) != ARRAY_TYPE
+-      || TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE
+-      || GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) != BITS_PER_UNIT
+-      || !tree_fits_shwi_p (TYPE_SIZE_UNIT (type)))
+-    return 0;
+-  total_bytes = tree_to_shwi (TYPE_SIZE_UNIT (type));
++  HOST_WIDE_INT total_bytes = tree_to_shwi (TYPE_SIZE_UNIT (TREE_TYPE (expr)));
+   if ((off == -1 && total_bytes > len)
+       || off >= total_bytes)
+     return 0;
+@@ -7502,6 +7500,22 @@
+     }
+ }
+ 
++/* Return true iff a STRING_CST S is accepted by
++   native_encode_expr.  */
++
++bool
++can_native_encode_string_p (const_tree expr)
++{
++  tree type = TREE_TYPE (expr);
++
++  if (TREE_CODE (type) != ARRAY_TYPE
++      || TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE
++      || (GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) != BITS_PER_UNIT)
++      || !tree_fits_shwi_p (TYPE_SIZE_UNIT (type)))
++    return false;
++  return true;
++}
++
+ /* Fold a VIEW_CONVERT_EXPR of a constant expression EXPR to type
+    TYPE at compile-time.  If we're unable to perform the conversion
+    return NULL_TREE.  */
+@@ -8879,7 +8893,7 @@
        tree op0 = fold_convert_loc (loc, type, TREE_OPERAND (aref0, 1));
        tree op1 = fold_convert_loc (loc, type, TREE_OPERAND (aref1, 1));
        tree esz = fold_convert_loc (loc, type, array_ref_element_size (aref0));
@@ -5686,7 +5808,7 @@ Index: gcc/fold-const.c
        return fold_build2_loc (loc, PLUS_EXPR, type,
  			      base_offset,
  			      fold_build2_loc (loc, MULT_EXPR, type,
-@@ -9638,11 +9641,6 @@
+@@ -9638,11 +9652,6 @@
  		       + (lit0 != 0) + (lit1 != 0)
  		       + (minus_lit0 != 0) + (minus_lit1 != 0))))
  	    {
@@ -5698,7 +5820,7 @@ Index: gcc/fold-const.c
  	      var0 = associate_trees (loc, var0, var1, code, atype);
  	      con0 = associate_trees (loc, con0, con1, code, atype);
  	      lit0 = associate_trees (loc, lit0, lit1, code, atype);
-@@ -9673,9 +9671,8 @@
+@@ -9673,9 +9682,8 @@
  		}
  
  	      /* Don't introduce overflows through reassociation.  */
@@ -5710,6 +5832,18 @@ Index: gcc/fold-const.c
  		return NULL_TREE;
  
  	      if (minus_lit0)
+Index: gcc/fold-const.h
+===================================================================
+--- a/src/gcc/fold-const.h	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/fold-const.h	(.../branches/gcc-7-branch)
+@@ -28,6 +28,7 @@
+ extern int native_encode_expr (const_tree, unsigned char *, int, int off = -1);
+ extern tree native_interpret_expr (tree, const unsigned char *, int);
+ extern bool can_native_encode_type_p (tree);
++extern bool can_native_encode_string_p (const_tree);
+ 
+ /* Fold constants as much as possible in an expression.
+    Returns the simplified expression.
 Index: gcc/omp-low.c
 ===================================================================
 --- a/src/gcc/omp-low.c	(.../tags/gcc_7_2_0_release)
@@ -5787,7 +5921,65 @@ Index: gcc/ChangeLog
 ===================================================================
 --- a/src/gcc/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,426 @@
+@@ -1,3 +1,484 @@
++2017-09-19  Uros Bizjak  <ubizjak at gmail.com>
++
++	* config/i386/i386.c (fold_builtin_cpu): Add M_AMDFAM17H
++	to processor_model and "amdfam17h" to arch_names_table.
++	* doc/extend.texi (__builtin_cpu_is): Document amdfam17h CPU name.
++
++2017-09-19  Martin Liska  <mliska at suse.cz>
++
++	PR c++/81355
++	* config/i386/i386.c (sorted_attr_string): Skip empty strings.
++
++2017-09-19  Martin Liska  <mliska at suse.cz>
++
++	Revert backport:
++	2017-08-10  Martin Liska  <mliska at suse.cz>
++
++	PR c++/81355
++	* c-attribs.c (handle_target_attribute):
++	Report warning for an empty string argument of target attribute.
++
++2017-09-18  Richard Biener  <rguenther at suse.de>
++
++	Backport from mainline
++	2017-09-04  Richard Biener  <rguenther at suse.de>
++
++	PR tree-optimization/82084
++	* fold-const.h (can_native_encode_string_p): Declare.
++	* fold-const.c (can_native_encode_string_p): Factor out from ...
++	(native_encode_string): ... here.
++	* tree-vect-stmts.c (vectorizable_store): Call it to avoid
++	vectorizing stores from constants we later cannot handle.
++
++	2017-09-06  Richard Biener  <rguenther at suse.de>
++
++	PR tree-optimization/82108
++	* tree-vect-stmts.c (vectorizable_load): Fix pointer adjustment
++	for gap in the non-permutation SLP case.
++
++2017-09-15  Jakub Jelinek  <jakub at redhat.com>
++
++	Backported from mainline
++	2017-09-14  Jakub Jelinek  <jakub at redhat.com>
++ 
++	PR target/81325
++	* cfgbuild.c (find_bb_boundaries): Ignore debug insns in decisions
++	if and where to split a bb, except for splitting before debug insn
++	sequences followed by non-label real insn.  Delete debug insns
++	in between basic blocks.
++
++	2017-09-12  Jakub Jelinek  <jakub at redhat.com>
++
++	PR target/82112
++	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): For
++	ALTIVEC_BUILTIN_VEC_LD if arg1 has array type call default_conversion
++	on it early, rather than manual conversion late.  For
++	ALTIVEC_BUILTIN_VEC_ST if arg2 has array type call default_conversion
++	instead of performing manual conversion.
++
 +2017-09-15  Martin Liska  <mliska at suse.cz>
 +
 +	Backport from mainline
@@ -6358,6 +6550,27 @@ Index: gcc/testsuite/gcc.target/powerpc/pr81833-2.c
 +    __builtin_abort ();
 +  return 0;
 +}
+Index: gcc/testsuite/gcc.target/powerpc/pr82112.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/powerpc/pr82112.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/powerpc/pr82112.c	(.../branches/gcc-7-branch)
+@@ -0,0 +1,16 @@
++/* PR target/82112 */
++/* { dg-do compile } */
++/* { dg-require-effective-target powerpc_altivec_ok } */
++/* { dg-options "-maltivec -std=gnu90" } */
++
++#include <altivec.h>
++
++struct __attribute__((aligned (16))) S { unsigned char c[64]; } bar (void);
++vector unsigned char v;
++
++void
++foo (void)
++{
++  vec_ld (0, bar ().c);	/* { dg-error "invalid parameter combination for AltiVec intrinsic" } */
++  vec_st (v, 0, bar ().c);	/* { dg-error "invalid parameter combination for AltiVec intrinsic" } */
++}
 Index: gcc/testsuite/gcc.target/powerpc/vec-setup.h
 ===================================================================
 --- a/src/gcc/testsuite/gcc.target/powerpc/vec-setup.h	(.../tags/gcc_7_2_0_release)
@@ -7917,6 +8130,32 @@ Index: gcc/testsuite/gnat.dg/specs/vfa1.ads
 +  pragma Volatile_Full_Access (Rec_VFA);
 +
 +end VFA1;
+Index: gcc/testsuite/gcc.dg/pr82112.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/pr82112.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/pr82112.c	(.../branches/gcc-7-branch)
+@@ -0,0 +1,21 @@
++/* PR target/82112 */
++/* { dg-do compile } */
++/* { dg-options "-std=gnu90" } */
++
++struct S { int a[10]; } bar (void);
++int b, c;
++
++void
++foo (void)
++{
++  __atomic_load (bar ().a, &b, __ATOMIC_ACQUIRE);	/* { dg-error "argument 1 of .__atomic_load. must be a non-void pointer type" } */
++  __atomic_load (&b, bar ().a, __ATOMIC_ACQUIRE);	/* { dg-error "argument 2 of .__atomic_load. must be a pointer type" } */
++  __atomic_store (bar ().a, &b, __ATOMIC_SEQ_CST);	/* { dg-error "argument 1 of .__atomic_store. must be a non-void pointer type" } */
++  __atomic_store (&b, bar ().a, __ATOMIC_SEQ_CST);	/* { dg-error "argument 2 of .__atomic_store. must be a pointer type" } */
++  __atomic_exchange (bar ().a, &b, &c, __ATOMIC_RELAXED);	/* { dg-error "argument 1 of .__atomic_exchange. must be a non-void pointer type" } */
++  __atomic_exchange (&b, bar ().a, &c, __ATOMIC_RELAXED);	/* { dg-error "argument 2 of .__atomic_exchange. must be a pointer type" } */
++  __atomic_exchange (&b, &c, bar ().a, __ATOMIC_RELAXED);	/* { dg-error "argument 3 of .__atomic_exchange. must be a pointer type" } */
++  __atomic_compare_exchange (bar ().a, &b, &c, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);	/* { dg-error "argument 1 of .__atomic_compare_exchange. must be a non-void pointer type" } */
++  __atomic_compare_exchange (&b, bar ().a, &c, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);	/* { dg-error "argument 2 of .__atomic_compare_exchange. must be a pointer type" } */
++  __atomic_compare_exchange (&b, &c, bar ().a, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);	/* { dg-error "argument 3 of .__atomic_compare_exchange. must be a pointer type" } */
++}
 Index: gcc/testsuite/gcc.dg/gimplefe-14.c
 ===================================================================
 --- a/src/gcc/testsuite/gcc.dg/gimplefe-14.c	(.../tags/gcc_7_2_0_release)
@@ -8151,11 +8390,102 @@ Index: gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c
  
 -/* { dg-final { scan-ipa-dump-times "Discovered an indirect call to a known target" 3 "cp" } } */
 +/* { dg-final { scan-ipa-dump-times "Discovered an indirect call to a known target" 3 "cp" { xfail { hppa*-*-* && { ! lp64 } } } } } */
+Index: gcc/testsuite/gcc.dg/vect/pr82108.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/vect/pr82108.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/vect/pr82108.c	(.../branches/gcc-7-branch)
+@@ -0,0 +1,47 @@
++/* { dg-do run } */
++/* { dg-require-effective-target vect_float } */
++
++#include "tree-vect.h"
++
++void __attribute__((noinline,noclone))
++downscale_2 (const float* src, int src_n, float* dst)
++{
++  int i;
++
++  for (i = 0; i < src_n; i += 2) {
++      const float* a = src;
++      const float* b = src + 4;
++
++      dst[0] = (a[0] + b[0]) / 2;
++      dst[1] = (a[1] + b[1]) / 2;
++      dst[2] = (a[2] + b[2]) / 2;
++      dst[3] = (a[3] + b[3]) / 2;
++
++      src += 2 * 4;
++      dst +=     4;
++  }
++}
++
++int main ()
++{
++  const float in[4 * 4] = {
++      1, 2, 3, 4,
++      5, 6, 7, 8,
++
++      1, 2, 3, 4,
++      5, 6, 7, 8
++  };
++  float out[2 * 4];
++
++  check_vect ();
++
++  downscale_2 (in, 4, out);
++
++  if (out[0] != 3 || out[1] != 4 || out[2] != 5 || out[3] != 6
++      || out[4] != 3 || out[5] != 4 || out[6] != 5 || out[7] != 6)
++    __builtin_abort ();
++  
++  return 0;
++}
++
++/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
 Index: gcc/testsuite/ChangeLog
 ===================================================================
 --- a/src/gcc/testsuite/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/testsuite/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,326 @@
+@@ -1,3 +1,365 @@
++2017-09-19  Martin Liska  <mliska at suse.cz>
++
++	Revert backport:
++	2017-08-10  Martin Liska  <mliska at suse.cz>
++
++	PR c++/81355
++	* g++.dg/other/pr81355.C: New test.
++
++2017-09-18  Richard Biener  <rguenther at suse.de>
++
++	Backport from mainline
++	2017-09-04  Richard Biener  <rguenther at suse.de>
++
++	PR tree-optimization/82084
++	* g++.dg/torture/pr82084.C: New testcase.
++
++	2017-09-06  Richard Biener  <rguenther at suse.de>
++
++	PR tree-optimization/82108
++	* gcc.dg/vect/pr82108.c: New testcase.
++
++2017-09-15  Jakub Jelinek  <jakub at redhat.com>
++
++	Backported from mainline
++	2017-09-14  Jakub Jelinek  <jakub at redhat.com>
++ 
++	PR target/81325
++	* g++.dg/cpp0x/pr81325.C: New test.
++
++	2017-09-12  Jakub Jelinek  <jakub at redhat.com>
++
++	PR target/82112
++	* gcc.target/powerpc/pr82112.c: New test.
++	* g++.dg/ext/altivec-18.C: New test.
++
++	PR target/82112
++	* c-c++-common/pr82112.c: New test.
++	* gcc.dg/pr82112.c: New test.
++
 +2017-09-15  Martin Liska  <mliska at suse.cz>
 +
 +	Backport from mainline
@@ -8482,6 +8812,138 @@ Index: gcc/testsuite/ChangeLog
  2017-08-14  Release Manager
  
  	* GCC 7.2.0 released.
+Index: gcc/testsuite/g++.dg/cpp0x/nullptr39.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp0x/nullptr39.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp0x/nullptr39.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,15 @@
++// PR c++/81671
++// { dg-do compile { target c++11 } }
++
++namespace std { typedef decltype(nullptr) nullptr_t; }
++
++template<class R, class CB> struct Bar
++{};
++template<class R> struct Bar<R, std::nullptr_t>
++{
++    template<std::nullptr_t> struct Bind { constexpr static int const cb = 0; };
++};
++int foo()
++{
++  return Bar<int, decltype(nullptr)>::Bind<nullptr>::cb;
++}
+Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,18 @@
++// PR c++/80767
++// { dg-do compile { target c++11 } }
++
++template <typename T, typename U = T> struct A { using type = U; };
++template <typename F, typename... G> struct B : B<F>::type, B<G...>::type {
++  using type = B;
++  using B<F>::type::operator();
++};
++template <typename F> struct B<F> { using type = F; };
++struct {
++  template <typename... F,
++            typename Overload = typename B<typename A<F>::type...>::type>
++  Overload operator()(F...){}
++} a;
++int main() {
++  auto f = a([](int) {}, [](float) {});
++  f({});
++}
+Index: gcc/testsuite/g++.dg/cpp0x/pr81325.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp0x/pr81325.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp0x/pr81325.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,84 @@
++// PR target/81325
++// { dg-do compile { target c++11 } }
++// { dg-options "-O2 -fcompare-debug" }
++
++struct A { A(const char *, const int & = 0); };
++template <typename> struct B;
++template <typename> struct C {
++  int _M_i;
++  void m_fn1() { __atomic_fetch_add(&_M_i, 0, __ATOMIC_RELAXED); }
++};
++struct D {
++  int *Data;
++  long Length = 0;
++  D(int) : Data() {}
++};
++template <> struct B<int> : C<int> {};
++struct F {
++  B<int> RefCount;
++  void m_fn2() { RefCount.m_fn1(); }
++};
++struct G {
++  F *Obj;
++  G(const G &p1) : Obj(p1.Obj) {
++    if (Obj) {
++      F *a = 0;
++      a->m_fn2();
++    }
++  }
++};
++struct H {
++  int CPlusPlus : 1;
++};
++struct I {
++  enum {} KindId;
++};
++template <typename ResultT, typename ArgT> struct J {
++  void operator()();
++  ResultT operator()(ArgT) {}
++};
++struct K {
++  int AllowBind;
++  I SupportedKind;
++  I RestrictKind;
++  G Implementation;
++};
++struct L {
++  L(int) : Implementation(Implementation) {}
++  K Implementation;
++};
++struct M {
++  int Param1;
++};
++struct N {
++  N(int, L &p2) : Param2(p2) {}
++  L Param2;
++};
++struct O {
++  L m_fn3();
++};
++L ignoringImpCasts(L);
++J<O, L> b;
++L hasName(const A &);
++M hasOverloadedOperatorName(D);
++J<O, int> c;
++struct P {
++  void m_fn4(L, int);
++};
++struct Q {
++  void m_fn5(P *);
++};
++H d;
++void Q::m_fn5(P *p1) {
++  if (!d.CPlusPlus) {
++    c();
++    L e = 0, f = ignoringImpCasts(e);
++    b(ignoringImpCasts(f)).m_fn3();
++  }
++  hasOverloadedOperatorName(0);
++  hasName("");
++  L g = 0;
++  N(0, g);
++  L h(0);
++  p1->m_fn4(h, 0);
++}
 Index: gcc/testsuite/g++.dg/torture/pr81884.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/torture/pr81884.C	(.../tags/gcc_7_2_0_release)
@@ -8555,6 +9017,20 @@ Index: gcc/testsuite/g++.dg/torture/pr81354.C
 +    }
 +  }
 +}
+Index: gcc/testsuite/g++.dg/torture/pr82084.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/torture/pr82084.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/torture/pr82084.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,9 @@
++// { dg-do compile }
++
++#include <string>
++int main()
++{
++  wchar_t strs[4][2]= {  L"A", L"B", L"C" , L"D"};
++  std::wstring ss(strs[0]);
++  return 0;
++}
 Index: gcc/testsuite/g++.dg/torture/pr81977.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/torture/pr81977.C	(.../tags/gcc_7_2_0_release)
@@ -8698,6 +9174,53 @@ Index: gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
  //  C++14 features allowed in C++11 in non-ANSI modes:
  
  #ifndef __cpp_binary_literals
+Index: gcc/testsuite/g++.dg/cpp1y/lambda-generic-this1.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-this1.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-this1.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,17 @@
++// PR c++/81236
++// { dg-do compile { target c++14 } }
++
++struct A { constexpr operator int() { return 24; } };
++
++struct MyType {
++  void crash() {
++    auto l = [&](auto i){
++      make_crash<i>(); // Line (1)
++    };
++
++    l(A{});
++  }
++    
++  template<int i>
++  void make_crash() {}
++};
+Index: gcc/testsuite/g++.dg/cpp1y/lambda-generic-const4.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const4.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const4.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,20 @@
++// PR c++/81525
++// { dg-do compile { target c++14 } }
++
++template <int i> struct A {
++  constexpr operator int () const { return i; }
++};
++template <int i> constexpr A<i> a = {};
++
++template <typename F> void foo (F f) {
++  f (A<0>{});
++}
++template <typename T>
++void bar (T) {
++  constexpr auto N = a<1>;
++  auto f = [&] (auto i) {
++    static_assert (static_cast<int>(N) == 1, "");
++  };
++  foo (f);
++}
++int main () { bar (0); }
 Index: gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C	(.../tags/gcc_7_2_0_release)
@@ -8734,6 +9257,28 @@ Index: gcc/testsuite/g++.dg/cpp1y/feat-cxx98.C
  //  C++14 features allowed in C++98 in non-ANSI modes:
  
  #ifndef __cpp_binary_literals
+Index: gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,17 @@
++// PR c++/78840
++// { dg-do compile { target c++14 } }
++
++int global;
++
++void Bar (int);
++
++template<int I> void Foo () {
++  const int cst = global;
++  auto lam0 = [&]() -> void {
++    auto lam1 = [&]() -> void { cst; };
++    
++    Bar (cst);
++  };
++}
++
++template void Foo <0> ();
 Index: gcc/testsuite/g++.dg/cpp1y/feat-neg.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/cpp1y/feat-neg.C	(.../tags/gcc_7_2_0_release)
@@ -8755,6 +9300,28 @@ Index: gcc/testsuite/g++.dg/cpp1y/feat-neg.C
 +#ifndef __cpp_threadsafe_static_init
 +#  error "__cpp_threadsafe_static_init" // { dg-error "error" }
 +#endif
+Index: gcc/testsuite/g++.dg/cpp1y/lambda-generic-this1a.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-this1a.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-this1a.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,17 @@
++// PR c++/81236
++// { dg-do compile { target c++14 } }
++
++struct A { constexpr operator int() { return 24; } };
++
++struct MyType {
++  void crash() {
++    auto l = [&](auto i){
++      MyType::make_crash<i>(); // Line (1)
++    };
++
++    l(A{});
++  }
++    
++  template<int i>
++  void make_crash() {}
++};
 Index: gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C	(.../tags/gcc_7_2_0_release)
@@ -8772,6 +9339,73 @@ Index: gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
  //  C++14 features:
  
  #ifndef __cpp_binary_literals
+Index: gcc/testsuite/g++.dg/cpp1z/constexpr-lambda16.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda16.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda16.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,15 @@
++// PR c++/80642
++// { dg-do compile { target c++14 } }
++
++int main()
++{
++  [](auto i)
++    {
++      if (i)
++        {
++	  int j;
++	  return i + j;
++        }
++      return i;
++    }(0);
++}
+Index: gcc/testsuite/g++.dg/cpp1z/lambda-inherit1.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1z/lambda-inherit1.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1z/lambda-inherit1.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,23 @@
++// PR c++/80767
++// { dg-options -std=c++17 }
++
++template <typename... Fs> 
++struct overloader : Fs...
++{
++    overloader(Fs... fs) 
++        : Fs(fs)...
++    { } 
++
++    using Fs::operator()...;
++};
++
++struct a { void foo() { } };
++struct b { void bar() { } };
++struct c { void bar() { } };
++
++int main() {
++    overloader{
++        [](a x) { x.foo(); },
++        [](auto x) { x.bar(); }
++    }(a{});
++}
+Index: gcc/testsuite/g++.dg/ext/altivec-18.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/ext/altivec-18.C	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/ext/altivec-18.C	(.../branches/gcc-7-branch)
+@@ -0,0 +1,14 @@
++// PR target/82112
++// { dg-do compile { target powerpc*-*-* } }
++// { dg-require-effective-target powerpc_altivec_ok }
++// { dg-options "-maltivec" }
++
++#include <altivec.h>
++
++__attribute__((aligned (16))) extern const unsigned char c[16];
++
++void
++foo (void)
++{
++  vec_ld (0, c);
++}
 Index: gcc/testsuite/g++.dg/pr80287.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/pr80287.C	(.../tags/gcc_7_2_0_release)
@@ -8804,25 +9438,6 @@ Index: gcc/testsuite/g++.dg/other/bitfield6.C
 +} d;
 +
 +char f = (903092 ? int(d.c) : 0) << a;
-Index: gcc/testsuite/g++.dg/other/pr81355.C
-===================================================================
---- a/src/gcc/testsuite/g++.dg/other/pr81355.C	(.../tags/gcc_7_2_0_release)
-+++ b/src/gcc/testsuite/g++.dg/other/pr81355.C	(.../branches/gcc-7-branch)
-@@ -0,0 +1,14 @@
-+/* { dg-do compile { target x86_64-*-* } } */
-+
-+__attribute__((target("default")))
-+int foo() {return 1;}
-+
-+__attribute__((target("arch=core2", "")))
-+int foo2() {return 2;} /* { dg-warning "empty string in attribute .target." } */
-+
-+__attribute__((target("sse4.2", "", "")))
-+int foo3() {return 2;} /* { dg-warning "empty string in attribute .target." } */
-+
-+int main() {
-+    return foo() + foo2() + foo3();
-+}
 Index: gcc/testsuite/g++.dg/warn/Wbool-operation-1.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/warn/Wbool-operation-1.C	(.../tags/gcc_7_2_0_release)
@@ -8908,6 +9523,24 @@ Index: gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-1.c
  
  #include <limits.h>
  #include "float-cast.h"
+Index: gcc/testsuite/c-c++-common/pr82112.c
+===================================================================
+--- a/src/gcc/testsuite/c-c++-common/pr82112.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/c-c++-common/pr82112.c	(.../branches/gcc-7-branch)
+@@ -0,0 +1,13 @@
++/* PR target/82112 */
++/* { dg-do compile } */
++
++int c[10], d[10], e[10], f[10], g[10], h[10], i[10], j[10], k[10], l[10];
++
++void
++foo (void)
++{
++  __atomic_load (c, d, __ATOMIC_ACQUIRE);
++  __atomic_store (e, f, __ATOMIC_SEQ_CST);
++  __atomic_exchange (g, h, i, __ATOMIC_RELAXED);
++  __atomic_compare_exchange (j, k, l, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
++}
 Index: gcc/testsuite/c-c++-common/pr81052.c
 ===================================================================
 --- a/src/gcc/testsuite/c-c++-common/pr81052.c	(.../tags/gcc_7_2_0_release)
@@ -8953,11 +9586,63 @@ Index: gcc/cp/typeck.c
  	      && warning_at (location, OPT_Wbool_operation,
  			     "%<~%> on an expression of type bool"))
  	    inform (location, "did you mean to use logical not (%<!%>)?");
+Index: gcc/cp/decl.c
+===================================================================
+--- a/src/gcc/cp/decl.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/decl.c	(.../branches/gcc-7-branch)
+@@ -5579,9 +5579,10 @@
+ 		   "uninitialized const %qD", decl);
+       else
+ 	{
+-	  error_at (DECL_SOURCE_LOCATION (decl),
+-		    "uninitialized variable %qD in %<constexpr%> function",
+-		    decl);
++	  if (!is_instantiation_of_constexpr (current_function_decl))
++	    error_at (DECL_SOURCE_LOCATION (decl),
++		      "uninitialized variable %qD in %<constexpr%> function",
++		      decl);
+ 	  cp_function_chain->invalid_constexpr = true;
+ 	}
+ 
 Index: gcc/cp/ChangeLog
 ===================================================================
 --- a/src/gcc/cp/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/cp/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,28 @@
+@@ -1,3 +1,62 @@
++2017-09-18  Jason Merrill  <jason at redhat.com>
++
++	PR c++/81236 - ICE with template-id in generic lambda
++	* parser.c (parsing_default_capturing_generic_lambda): Don't check
++	for enclosing template.
++	* semantics.c (finish_qualified_id_expr): Call it.
++	* cp-tree.h: Adjust.
++
++	PR c++/80767 - unnecessary instantiation of generic lambda
++	PR c++/82030 - ICE inheriting from multiple lambdas
++	* call.c (convert_like_real): Call build_user_type_conversion_1 if
++	cand is null.
++	(add_conv_candidate): Build a ck_user conversion with no candidate.
++
++	PR c++/80935 - wrong C++17 error with lambda
++	* decl.c (check_for_uninitialized_const_var): Check
++	is_instantiation_of_constexpr.
++
++	PR c++/81671 - nullptr_t template parameter
++	* pt.c (convert_nontype_argument): Fix nullptr_t check.
++
++	PR c++/81525 - wrong constant value with generic lambda
++	* pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
++	(tsubst_copy) [VAR_DECL]: Handle auto.
++
++2017-09-15  Jakub Jelinek  <jakub at redhat.com>
++
++	Backported from mainline
++	2017-09-14  Jakub Jelinek  <jakub at redhat.com>
++
++	PR c++/81314
++	* cp-gimplify.c (omp_var_to_track): Look through references.
++	(omp_cxx_notice_variable): Likewise.
++
 +2017-09-09  Eric Botcazou  <ebotcazou at adacore.com>
 +
 +	PR bootstrap/81926
@@ -8986,7 +9671,7 @@ Index: gcc/cp/ChangeLog
  2017-08-14  Release Manager
  
  	* GCC 7.2.0 released.
-@@ -4,8 +29,8 @@
+@@ -4,8 +63,8 @@
  
  2017-08-09  Leonid Koppel  <lkoppel at uwaterloo.ca>
  
@@ -9001,7 +9686,25 @@ Index: gcc/cp/cp-gimplify.c
 ===================================================================
 --- a/src/gcc/cp/cp-gimplify.c	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/cp/cp-gimplify.c	(.../branches/gcc-7-branch)
-@@ -2311,9 +2311,9 @@
+@@ -924,6 +924,8 @@
+   tree type = TREE_TYPE (decl);
+   if (is_invisiref_parm (decl))
+     type = TREE_TYPE (type);
++  else if (TREE_CODE (type) == REFERENCE_TYPE)
++    type = TREE_TYPE (type);
+   while (TREE_CODE (type) == ARRAY_TYPE)
+     type = TREE_TYPE (type);
+   if (type == error_mark_node || !CLASS_TYPE_P (type))
+@@ -976,6 +978,8 @@
+ 	      tree type = TREE_TYPE (decl);
+ 	      if (is_invisiref_parm (decl))
+ 		type = TREE_TYPE (type);
++	      else if (TREE_CODE (type) == REFERENCE_TYPE)
++		type = TREE_TYPE (type);
+ 	      while (TREE_CODE (type) == ARRAY_TYPE)
+ 		type = TREE_TYPE (type);
+ 	      get_copy_ctor (type, tf_none);
+@@ -2311,9 +2315,9 @@
  
        /* A COND_EXPR might have incompatible types in branches if one or both
  	 arms are bitfields.  If folding exposed such a branch, fix it up.  */
@@ -9014,6 +9717,145 @@ Index: gcc/cp/cp-gimplify.c
  
        break;
  
+Index: gcc/cp/pt.c
+===================================================================
+--- a/src/gcc/cp/pt.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/pt.c	(.../branches/gcc-7-branch)
+@@ -6849,7 +6849,7 @@
+     }
+   else if (NULLPTR_TYPE_P (type))
+     {
+-      if (expr != nullptr_node)
++      if (!NULLPTR_TYPE_P (TREE_TYPE (expr)))
+ 	{
+ 	  if (complain & tf_error)
+ 	    error ("%qE is not a valid template argument for type %qT "
+@@ -12896,7 +12896,15 @@
+ 		&& VAR_HAD_UNKNOWN_BOUND (t)
+ 		&& type != error_mark_node)
+ 	      type = strip_array_domain (type);
++	    tree auto_node = type_uses_auto (type);
++	    int len = TREE_VEC_LENGTH (args);
++	    if (auto_node)
++	      /* Mask off any template args past the variable's context so we
++		 don't replace the auto with an unrelated argument.  */
++	      TREE_VEC_LENGTH (args) = TEMPLATE_TYPE_LEVEL (auto_node) - 1;
+ 	    type = tsubst (type, args, complain, in_decl);
++	    if (auto_node)
++	      TREE_VEC_LENGTH (args) = len;
+ 	  }
+ 	if (VAR_P (r))
+ 	  {
+@@ -14687,6 +14695,10 @@
+ 			DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r)
+ 			  = TREE_CONSTANT (r) = true;
+ 		      DECL_INITIAL (r) = init;
++		      if (tree auto_node = type_uses_auto (TREE_TYPE (r)))
++			TREE_TYPE (r)
++			  = do_auto_deduction (TREE_TYPE (r), init, auto_node,
++					       complain, adc_variable_type);
+ 		    }
+ 		  gcc_assert (cp_unevaluated_operand || TREE_STATIC (r)
+ 			      || decl_constant_var_p (r)
+Index: gcc/cp/semantics.c
+===================================================================
+--- a/src/gcc/cp/semantics.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/semantics.c	(.../branches/gcc-7-branch)
+@@ -2008,7 +2008,9 @@
+ 					    qualifying_class);
+       pop_deferring_access_checks ();
+     }
+-  else if (BASELINK_P (expr) && !processing_template_decl)
++  else if (BASELINK_P (expr)
++	   && (!processing_template_decl
++	       || parsing_default_capturing_generic_lambda ()))
+     {
+       /* See if any of the functions are non-static members.  */
+       /* If so, the expression may be relative to 'this'.  */
+@@ -3584,12 +3586,12 @@
+ 		    : CP_ID_KIND_UNQUALIFIED)));
+ 
+       /* If the name was dependent on a template parameter and we're not in a
+-	 default capturing generic lambda within a template, we will resolve the
++	 default capturing generic lambda, we will resolve the
+ 	 name at instantiation time.  FIXME: For lambdas, we should defer
+ 	 building the closure type until instantiation time then we won't need
+ 	 the extra test here.  */
+       if (dependent_p
+-	  && !parsing_default_capturing_generic_lambda_in_template ())
++	  && !parsing_default_capturing_generic_lambda ())
+ 	{
+ 	  if (DECL_P (decl)
+ 	      && any_dependent_type_attributes_p (DECL_ATTRIBUTES (decl)))
+Index: gcc/cp/parser.c
+===================================================================
+--- a/src/gcc/cp/parser.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/parser.c	(.../branches/gcc-7-branch)
+@@ -20486,7 +20486,7 @@
+    which we ultimately want to defer to instantiation time. */
+ 
+ bool
+-parsing_default_capturing_generic_lambda_in_template (void)
++parsing_default_capturing_generic_lambda (void)
+ {
+   if (!processing_template_decl || !current_class_type)
+     return false;
+@@ -20499,12 +20499,7 @@
+   if (!callop)
+     return false;
+ 
+-  return (DECL_TEMPLATE_INFO (callop)
+-	  && (DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (callop)) == callop)
+-	  && ((current_nonlambda_class_type ()
+-	       && CLASSTYPE_TEMPLATE_INFO (current_nonlambda_class_type ()))
+-	      || ((current_nonlambda_function ()
+-		   && DECL_TEMPLATE_INFO (current_nonlambda_function ())))));
++  return generic_lambda_fn_p (callop);
+ }
+ 
+ /* Parse a late-specified return type, if any.  This is not a separate
+Index: gcc/cp/call.c
+===================================================================
+--- a/src/gcc/cp/call.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/call.c	(.../branches/gcc-7-branch)
+@@ -2279,8 +2279,10 @@
+ 
+       if (i == 0)
+ 	{
+-	  t = implicit_conversion (totype, argtype, arg, /*c_cast_p=*/false,
+-				   flags, complain);
++	  t = build_identity_conv (argtype, NULL_TREE);
++	  t = build_conv (ck_user, totype, t);
++	  /* Leave the 'cand' field null; we'll figure out the conversion in
++	     convert_like_real if this candidate is chosen.  */
+ 	  convert_type = totype;
+ 	}
+       else if (parmnode == void_list_node)
+@@ -6665,6 +6667,13 @@
+     case ck_user:
+       {
+ 	struct z_candidate *cand = convs->cand;
++
++	if (cand == NULL)
++	  /* We chose the surrogate function from add_conv_candidate, now we
++	     actually need to build the conversion.  */
++	  cand = build_user_type_conversion_1 (totype, expr,
++					       LOOKUP_NO_CONVERSION, complain);
++
+ 	tree convfn = cand->fn;
+ 
+ 	/* When converting from an init list we consider explicit
+@@ -9128,7 +9137,9 @@
+ 	return 0;
+       else if (t1->kind == ck_user)
+ 	{
+-	  if (t1->cand->fn != t2->cand->fn)
++	  tree f1 = t1->cand ? t1->cand->fn : t1->type;
++	  tree f2 = t2->cand ? t2->cand->fn : t2->type;
++	  if (f1 != f2)
+ 	    return 0;
+ 	}
+       else
 Index: gcc/cp/cp-objcp-common.c
 ===================================================================
 --- a/src/gcc/cp/cp-objcp-common.c	(.../tags/gcc_7_2_0_release)
@@ -9078,6 +9920,19 @@ Index: gcc/cp/cp-objcp-common.c
    return NULL_TREE;
  }
  
+Index: gcc/cp/cp-tree.h
+===================================================================
+--- a/src/gcc/cp/cp-tree.h	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/cp-tree.h	(.../branches/gcc-7-branch)
+@@ -6125,7 +6125,7 @@
+ /* In parser.c */
+ extern tree cp_convert_range_for (tree, tree, tree, tree, unsigned int, bool);
+ extern bool parsing_nsdmi (void);
+-extern bool parsing_default_capturing_generic_lambda_in_template (void);
++extern bool parsing_default_capturing_generic_lambda (void);
+ extern void inject_this_parameter (tree, cp_cv_quals);
+ 
+ /* in pt.c */
 Index: gcc/omp-expand.c
 ===================================================================
 --- a/src/gcc/omp-expand.c	(.../tags/gcc_7_2_0_release)
@@ -9388,6 +10243,107 @@ Index: gcc/dwarf2out.c
  	    {
  	      dw_loc_descr_ref loc = NULL;
  	      if (! early_dwarf
+Index: gcc/cfgbuild.c
+===================================================================
+--- a/src/gcc/cfgbuild.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cfgbuild.c	(.../branches/gcc-7-branch)
+@@ -442,9 +442,10 @@
+   rtx_insn *end = BB_END (bb), *x;
+   rtx_jump_table_data *table;
+   rtx_insn *flow_transfer_insn = NULL;
++  rtx_insn *debug_insn = NULL;
+   edge fallthru = NULL;
+ 
+-  if (insn == BB_END (bb))
++  if (insn == end)
+     return;
+ 
+   if (LABEL_P (insn))
+@@ -455,27 +456,49 @@
+     {
+       enum rtx_code code = GET_CODE (insn);
+ 
++      if (code == DEBUG_INSN)
++	{
++	  if (flow_transfer_insn && !debug_insn)
++	    debug_insn = insn;
++	}
+       /* In case we've previously seen an insn that effects a control
+ 	 flow transfer, split the block.  */
+-      if ((flow_transfer_insn || code == CODE_LABEL)
+-	  && inside_basic_block_p (insn))
++      else if ((flow_transfer_insn || code == CODE_LABEL)
++	       && inside_basic_block_p (insn))
+ 	{
+-	  fallthru = split_block (bb, PREV_INSN (insn));
++	  rtx_insn *prev = PREV_INSN (insn);
++
++	  /* If the first non-debug inside_basic_block_p insn after a control
++	     flow transfer is not a label, split the block before the debug
++	     insn instead of before the non-debug insn, so that the debug
++	     insns are not lost.  */
++	  if (debug_insn && code != CODE_LABEL && code != BARRIER)
++	    prev = PREV_INSN (debug_insn);
++	  fallthru = split_block (bb, prev);
+ 	  if (flow_transfer_insn)
+ 	    {
+ 	      BB_END (bb) = flow_transfer_insn;
+ 
++	      rtx_insn *next;
+ 	      /* Clean up the bb field for the insns between the blocks.  */
+ 	      for (x = NEXT_INSN (flow_transfer_insn);
+ 		   x != BB_HEAD (fallthru->dest);
+-		   x = NEXT_INSN (x))
+-		if (!BARRIER_P (x))
+-		  set_block_for_insn (x, NULL);
++		   x = next)
++		{
++		  next = NEXT_INSN (x);
++		  /* Debug insns should not be in between basic blocks,
++		     drop them on the floor.  */
++		  if (DEBUG_INSN_P (x))
++		    delete_insn (x);
++		  else if (!BARRIER_P (x))
++		    set_block_for_insn (x, NULL);
++		}
+ 	    }
+ 
+ 	  bb = fallthru->dest;
+ 	  remove_edge (fallthru);
+ 	  flow_transfer_insn = NULL;
++	  debug_insn = NULL;
+ 	  if (code == CODE_LABEL && LABEL_ALT_ENTRY_P (insn))
+ 	    make_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun), bb, 0);
+ 	}
+@@ -498,17 +521,23 @@
+   /* In case expander replaced normal insn by sequence terminating by
+      return and barrier, or possibly other sequence not behaving like
+      ordinary jump, we need to take care and move basic block boundary.  */
+-  if (flow_transfer_insn)
++  if (flow_transfer_insn && flow_transfer_insn != end)
+     {
+       BB_END (bb) = flow_transfer_insn;
+ 
+       /* Clean up the bb field for the insns that do not belong to BB.  */
+-      x = flow_transfer_insn;
+-      while (x != end)
++      rtx_insn *next;
++      for (x = NEXT_INSN (flow_transfer_insn); ; x = next)
+ 	{
+-	  x = NEXT_INSN (x);
+-	  if (!BARRIER_P (x))
++	  next = NEXT_INSN (x);
++	  /* Debug insns should not be in between basic blocks,
++	     drop them on the floor.  */
++	  if (DEBUG_INSN_P (x))
++	    delete_insn (x);
++	  else if (!BARRIER_P (x))
+ 	    set_block_for_insn (x, NULL);
++	  if (x == end)
++	    break;
+ 	}
+     }
+ 
 Index: gcc/opts.c
 ===================================================================
 --- a/src/gcc/opts.c	(.../tags/gcc_7_2_0_release)
@@ -312590,6 +313546,41 @@ Index: gcc/po/zh_CN.po
  #~ msgid "bad method signature"
  #~ msgstr "错误的方法签名"
  
+Index: gcc/tree-vect-stmts.c
+===================================================================
+--- a/src/gcc/tree-vect-stmts.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/tree-vect-stmts.c	(.../branches/gcc-7-branch)
+@@ -5702,6 +5702,12 @@
+ 
+   op = gimple_assign_rhs1 (stmt);
+ 
++  /* In the case this is a store from a STRING_CST make sure
++     native_encode_expr can handle it.  */
++  if (TREE_CODE (op) == STRING_CST
++      && ! can_native_encode_string_p (op))
++    return false;
++
+   if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt, &rhs_vectype))
+     {
+       if (dump_enabled_p ())
+@@ -7109,7 +7115,6 @@
+     {
+       first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
+       group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
+-      int group_gap = GROUP_GAP (vinfo_for_stmt (first_stmt));
+       /* For SLP vectorization we directly vectorize a subchain
+          without permutation.  */
+       if (slp && ! SLP_TREE_LOAD_PERMUTATION (slp_node).exists ())
+@@ -7152,7 +7157,8 @@
+ 	  else
+ 	    {
+ 	      vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
+-	      group_gap_adj = group_gap;
++	      group_gap_adj
++		= group_size - SLP_INSTANCE_GROUP_SIZE (slp_node_instance);
+ 	    }
+     	}
+       else
 Index: gcc/bb-reorder.c
 ===================================================================
 --- a/src/gcc/bb-reorder.c	(.../tags/gcc_7_2_0_release)
@@ -312808,6 +313799,54 @@ Index: gcc/config/i386/i386.c
  	ret = false;
  
        else if (caller_opts->branch_cost != callee_opts->branch_cost)
+@@ -32826,6 +32836,9 @@
+     {
+       const char *str = TREE_STRING_POINTER (TREE_VALUE (arg));
+       size_t len = strlen (str);
++      /* Skip empty string.  */
++      if (len == 0)
++	continue;
+       str_len_sum += len + 1;
+       if (arg != arglist)
+ 	argnum++;
+@@ -32840,11 +32853,21 @@
+     {
+       const char *str = TREE_STRING_POINTER (TREE_VALUE (arg));
+       size_t len = strlen (str);
++      /* Skip empty string.  */
++      if (len == 0)
++	continue;
+       memcpy (attr_str + str_len_sum, str, len);
+       attr_str[str_len_sum + len] = TREE_CHAIN (arg) ? ',' : '\0';
+       str_len_sum += len + 1;
+     }
+ 
++  /* Strip ',' character at the end.  */
++  if (str_len_sum > 0 && attr_str[str_len_sum - 1] == ',')
++    {
++      attr_str[str_len_sum - 1] = '\0';
++      str_len_sum--;
++    }
++
+   /* Replace "=,-" with "_".  */
+   for (i = 0; i < strlen (attr_str); i++)
+     if (attr_str[i] == '=' || attr_str[i]== '-')
+@@ -33464,6 +33487,7 @@
+     M_INTEL_KNL,
+     M_AMD_BTVER1,
+     M_AMD_BTVER2,    
++    M_AMDFAM17H,
+     M_CPU_SUBTYPE_START,
+     M_INTEL_COREI7_NEHALEM,
+     M_INTEL_COREI7_WESTMERE,
+@@ -33518,6 +33542,7 @@
+       {"bdver3", M_AMDFAM15H_BDVER3},
+       {"bdver4", M_AMDFAM15H_BDVER4},
+       {"btver2", M_AMD_BTVER2},
++      {"amdfam17h", M_AMDFAM17H},
+       {"znver1", M_AMDFAM17H_ZNVER1},
+     };
+ 
 Index: gcc/config/sol2.h
 ===================================================================
 --- a/src/gcc/config/sol2.h	(.../tags/gcc_7_2_0_release)
@@ -313159,6 +314198,58 @@ Index: gcc/config/rs6000/rtems.h
  #undef	ASM_DECLARE_FUNCTION_SIZE
  #define	ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)			\
    do									\
+Index: gcc/config/rs6000/rs6000-c.c
+===================================================================
+--- a/src/gcc/config/rs6000/rs6000-c.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/config/rs6000/rs6000-c.c	(.../branches/gcc-7-branch)
+@@ -6218,7 +6218,13 @@
+ 
+       /* Strip qualifiers like "const" from the pointer arg.  */
+       tree arg1_type = TREE_TYPE (arg1);
+-      if (!POINTER_TYPE_P (arg1_type) && TREE_CODE (arg1_type) != ARRAY_TYPE)
++      if (TREE_CODE (arg1_type) == ARRAY_TYPE && c_dialect_cxx ())
++	{
++	  /* Force array-to-pointer decay for C++.  */
++	  arg1 = default_conversion (arg1);
++	  arg1_type = TREE_TYPE (arg1);
++	}
++      if (!POINTER_TYPE_P (arg1_type))
+ 	goto bad;
+ 
+       tree inner_type = TREE_TYPE (arg1_type);
+@@ -6238,15 +6244,6 @@
+ 	  if (!ptrofftype_p (TREE_TYPE (arg0)))
+ 	    arg0 = build1 (NOP_EXPR, sizetype, arg0);
+ 
+-	  tree arg1_type = TREE_TYPE (arg1);
+-	  if (TREE_CODE (arg1_type) == ARRAY_TYPE)
+-	    {
+-	      arg1_type = TYPE_POINTER_TO (TREE_TYPE (arg1_type));
+-	      tree const0 = build_int_cstu (sizetype, 0);
+-	      tree arg1_elt0 = build_array_ref (loc, arg1, const0);
+-	      arg1 = build1 (ADDR_EXPR, arg1_type, arg1_elt0);
+-	    }
+-
+ 	  tree addr = fold_build2_loc (loc, POINTER_PLUS_EXPR, arg1_type,
+ 				       arg1, arg0);
+ 	  tree aligned = fold_build2_loc (loc, BIT_AND_EXPR, arg1_type, addr,
+@@ -6301,12 +6298,11 @@
+ 	    arg1 = build1 (NOP_EXPR, sizetype, arg1);
+ 
+ 	  tree arg2_type = TREE_TYPE (arg2);
+-	  if (TREE_CODE (arg2_type) == ARRAY_TYPE)
++	  if (TREE_CODE (arg2_type) == ARRAY_TYPE && c_dialect_cxx ())
+ 	    {
+-	      arg2_type = TYPE_POINTER_TO (TREE_TYPE (arg2_type));
+-	      tree const0 = build_int_cstu (sizetype, 0);
+-	      tree arg2_elt0 = build_array_ref (loc, arg2, const0);
+-	      arg2 = build1 (ADDR_EXPR, arg2_type, arg2_elt0);
++	      /* Force array-to-pointer decay for C++.  */
++	      arg2 = default_conversion (arg2);
++	      arg2_type = TREE_TYPE (arg2);
+ 	    }
+ 
+ 	  /* Find the built-in to make sure a compatible one exists; if not
 Index: gcc/config/rs6000/rs6000.c
 ===================================================================
 --- a/src/gcc/config/rs6000/rs6000.c	(.../tags/gcc_7_2_0_release)
@@ -313929,3 +315020,220 @@ Index: gcc/tree-vect-slp.c
    if (node != NULL)
      {
        /* Calculate the unrolling factor based on the smallest type.  */
+Index: libgfortran/ChangeLog
+===================================================================
+--- a/src/libgfortran/ChangeLog	(.../tags/gcc_7_2_0_release)
++++ b/src/libgfortran/ChangeLog	(.../branches/gcc-7-branch)
+@@ -1,3 +1,15 @@
++2017-09-19  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR libgfortran/78387
++	* io/list_read.c (nml_read_obj): Remove use of stash.
++	* io/transfer.c (st_read_done, st_write_done): Likewise.
++	* io/unit.c (stash_internal_unit): Delete function.
++	(get_unit): Remove use of stash.
++	(init_units): Likewise.
++	(close_units): Likewise.
++	* io/write.c (nml_write_obj): Likewise:
++
+ 2017-08-14  Release Manager
+ 
+ 	* GCC 7.2.0 released.
+Index: libgfortran/io/list_read.c
+===================================================================
+--- a/src/libgfortran/io/list_read.c	(.../tags/gcc_7_2_0_release)
++++ b/src/libgfortran/io/list_read.c	(.../branches/gcc-7-branch)
+@@ -3019,11 +3019,6 @@
+ 		    child_iomsg_len = IOMSG_LEN;
+ 		  }
+ 
+-		/* If reading from an internal unit, stash it to allow
+-		   the child procedure to access it.  */
+-		if (is_internal_unit (dtp))
+-		  stash_internal_unit (dtp);
+-
+ 		/* Call the user defined formatted READ procedure.  */
+ 		dtp->u.p.current_unit->child_dtio++;
+ 		dtio_ptr ((void *)&list_obj, &unit, iotype, &vlist,
+Index: libgfortran/io/unit.c
+===================================================================
+--- a/src/libgfortran/io/unit.c	(.../tags/gcc_7_2_0_release)
++++ b/src/libgfortran/io/unit.c	(.../branches/gcc-7-branch)
+@@ -94,16 +94,6 @@
+ /* Unit numbers assigned with NEWUNIT start from here.  */
+ #define NEWUNIT_START -10
+ 
+-
+-#define NEWUNIT_STACK_SIZE 16
+-
+-/* A stack to save previously used newunit-assigned unit numbers to
+-   allow them to be reused without reallocating the gfc_unit structure
+-   which is still in the treap.  */
+-static gfc_saved_unit newunit_stack[NEWUNIT_STACK_SIZE];
+-static int newunit_tos = 0; /* Index to Top of Stack.  */
+-
+-
+ #define CACHE_SIZE 3
+ static gfc_unit *unit_cache[CACHE_SIZE];
+ gfc_offset max_offset;
+@@ -538,22 +528,6 @@
+ }
+ 
+ 
+-/* stash_internal_unit()-- Push the internal unit number onto the
+-   avaialble stack.  */
+-void
+-stash_internal_unit (st_parameter_dt *dtp)
+-{
+-  __gthread_mutex_lock (&unit_lock);
+-  newunit_tos++;
+-  if (newunit_tos >= NEWUNIT_STACK_SIZE)
+-    internal_error (&dtp->common, "stash_internal_unit(): Stack Size Exceeded");
+-  newunit_stack[newunit_tos].unit_number = dtp->common.unit;
+-  newunit_stack[newunit_tos].unit = dtp->u.p.current_unit;
+-  __gthread_mutex_unlock (&unit_lock);
+-}
+-
+-
+-
+ /* get_unit()-- Returns the unit structure associated with the integer
+    unit or the internal file.  */
+ 
+@@ -572,49 +546,13 @@
+       else
+ 	internal_error (&dtp->common, "get_unit(): Bad internal unit KIND");
+ 
+-      if ((dtp->common.flags & IOPARM_DT_HAS_UDTIO) != 0)
+-	{
+-	  dtp->u.p.unit_is_internal = 1;
+-	  dtp->common.unit = newunit_alloc ();
+-	  unit = get_gfc_unit (dtp->common.unit, do_create);
+-	  set_internal_unit (dtp, unit, kind);
+-	  fbuf_init (unit, 128);
+-	  return unit;
+-	}
+-      else
+-	{
+-	  __gthread_mutex_lock (&unit_lock);
+-	  if (newunit_tos)
+-	    {
+-	      dtp->common.unit = newunit_stack[newunit_tos].unit_number;
+-	      unit = newunit_stack[newunit_tos--].unit;
+-	      __gthread_mutex_unlock (&unit_lock);
+-	      unit->fbuf->act = unit->fbuf->pos = 0;
+-	    }
+-	  else
+-	    {
+-	      __gthread_mutex_unlock (&unit_lock);
+-	      dtp->common.unit = newunit_alloc ();
+-	      unit = xcalloc (1, sizeof (gfc_unit));
+-	      fbuf_init (unit, 128);
+-	    }
+-	  set_internal_unit (dtp, unit, kind);
+-	  return unit;
+-	}
+-    }
+-
+-  /* If an internal unit number is passed from the parent to the child
+-     it should have been stashed on the newunit_stack ready to be used.
+-     Check for it now and return the internal unit if found.  */
+-  __gthread_mutex_lock (&unit_lock);
+-  if (newunit_tos && (dtp->common.unit <= NEWUNIT_START)
+-      && (dtp->common.unit == newunit_stack[newunit_tos].unit_number))
+-    {
+-      unit = newunit_stack[newunit_tos--].unit;
+-      __gthread_mutex_unlock (&unit_lock);
++      dtp->u.p.unit_is_internal = 1;
++      dtp->common.unit = newunit_alloc ();
++      unit = get_gfc_unit (dtp->common.unit, do_create);
++      set_internal_unit (dtp, unit, kind);
++      fbuf_init (unit, 128);
+       return unit;
+     }
+-  __gthread_mutex_unlock (&unit_lock);
+ 
+   /* Has to be an external unit.  */
+   dtp->u.p.unit_is_internal = 0;
+@@ -752,10 +690,6 @@
+   max_offset = 0;
+   for (i = 0; i < sizeof (max_offset) * 8 - 1; i++)
+     max_offset = max_offset + ((gfc_offset) 1 << i);
+-
+-  /* Initialize the newunit stack.  */
+-  memset (newunit_stack, 0, NEWUNIT_STACK_SIZE * sizeof(gfc_saved_unit));
+-  newunit_tos = 0;
+ }
+ 
+ 
+@@ -837,14 +771,6 @@
+     close_unit_1 (unit_root, 1);
+   __gthread_mutex_unlock (&unit_lock);
+ 
+-  while (newunit_tos != 0)
+-    if (newunit_stack[newunit_tos].unit)
+-      {
+-	fbuf_destroy (newunit_stack[newunit_tos].unit);
+-	free (newunit_stack[newunit_tos].unit->s);
+-	free (newunit_stack[newunit_tos--].unit);
+-      }
+-
+   free (newunits);
+ 
+ #ifdef HAVE_FREELOCALE
+Index: libgfortran/io/transfer.c
+===================================================================
+--- a/src/libgfortran/io/transfer.c	(.../tags/gcc_7_2_0_release)
++++ b/src/libgfortran/io/transfer.c	(.../branches/gcc-7-branch)
+@@ -4080,8 +4080,7 @@
+   free_ionml (dtp);
+ 
+   /* If this is a parent READ statement we do not need to retain the
+-     internal unit structure for child use.  Free it and stash the unit
+-     number for reuse.  */
++     internal unit structure for child use.  */
+   if (dtp->u.p.current_unit != NULL
+       && dtp->u.p.current_unit->child_dtio == 0)
+     {
+@@ -4095,7 +4094,6 @@
+ 	  if (dtp->u.p.current_unit->ls)
+ 	    free (dtp->u.p.current_unit->ls);
+ 	  dtp->u.p.current_unit->ls = NULL;
+-	  stash_internal_unit (dtp);
+ 	}
+       if (is_internal_unit (dtp) || dtp->u.p.format_not_saved)
+ 	{
+@@ -4153,8 +4151,7 @@
+       free_ionml (dtp);
+ 
+       /* If this is a parent WRITE statement we do not need to retain the
+-	 internal unit structure for child use.  Free it and stash the
+-	 unit number for reuse.  */
++	 internal unit structure for child use.  */
+       if (is_internal_unit (dtp) &&
+ 	  (dtp->common.flags & IOPARM_DT_HAS_UDTIO) == 0)
+ 	{
+@@ -4165,7 +4162,6 @@
+ 	  if (dtp->u.p.current_unit->ls)
+ 	    free (dtp->u.p.current_unit->ls);
+ 	  dtp->u.p.current_unit->ls = NULL;
+-	  stash_internal_unit (dtp);
+ 	}
+       if (is_internal_unit (dtp) || dtp->u.p.format_not_saved)
+ 	{
+Index: libgfortran/io/write.c
+===================================================================
+--- a/src/libgfortran/io/write.c	(.../tags/gcc_7_2_0_release)
++++ b/src/libgfortran/io/write.c	(.../branches/gcc-7-branch)
+@@ -2248,11 +2248,6 @@
+ 		      child_iomsg_len = IOMSG_LEN;
+ 		    }
+ 
+-		  /* If writing to an internal unit, stash it to allow
+-		     the child procedure to access it.  */
+-		  if (is_internal_unit (dtp))
+-		    stash_internal_unit (dtp);
+-		      
+ 		  /* Call the user defined formatted WRITE procedure.  */
+ 		  dtp->u.p.current_unit->child_dtio++;
+ 		  if (obj->type == BT_DERIVED)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-7.git



More information about the Reproducible-commits mailing list