[gcc-7] 288/354: * Update to SVN 20170912 (r251998) from the gcc-7-branch.
Ximin Luo
infinity0 at debian.org
Thu Nov 23 15:51:19 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 a29e41878fe5a248a0f39da0435cff20de1c4e94
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Tue Sep 12 08:33:51 2017 +0000
* Update to SVN 20170912 (r251998) from the gcc-7-branch.
git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9670 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 10 +
debian/patches/svn-updates.diff | 1729 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 1714 insertions(+), 25 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 7d7198b..6683ce3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+gcc-7 (7.2.0-5) UNRELEASED; urgency=medium
+
+ * Update to SVN 20170912 (r251998) from the gcc-7-branch.
+ - Fix PR c/81687, PR c/45784, PR c++/81852, PR target/82181 (xtensa),
+ PR target/80695 (PPC), PR target/81988 (SPARC), PR middle-end/81768,
+ PR sanitizer/81923, PR target/81621, PR driver/81650,
+ PR middle-end/81052, PR tree-optimization/81987, PR bootstrap/81926.
+
+ -- Matthias Klose <doko at debian.org> Tue, 12 Sep 2017 10:27:32 +0200
+
gcc-7 (7.2.0-4) unstable; urgency=medium
* Update to SVN 20170906 (r251753) from the gcc-7-branch.
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index a42984b..aa7aa4e 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 7 branch upto 20170906 (r251753).
+# DP: updates from the 7 branch upto 20170912 (r251998).
last_update()
{
cat > ${dir}LAST_UPDATED <EOF
-Wed Sep 6 10:35:25 CEST 2017
-Wed Sep 6 08:35:25 UTC 2017 (revision 251753)
+Tue Sep 12 10:04:40 CEST 2017
+Tue Sep 12 08:04:40 UTC 2017 (revision 251998)
EOF
}
@@ -12,6 +12,172 @@ LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_7_2_0_release svn://gcc.gnu.o
| sed -r 's,^--- (\S+)\t(\S+)(.*)$,--- a/src/\1\t\2,;s,^\+\+\+ (\S+)\t(\S+)(.*)$,+++ b/src/\1\t\2,' \
| awk '/^Index:.*\.(class|texi)/ {skip=1; next} /^Index:/ { skip=0 } skip==0'
+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 @@
++2017-09-07 Jakub Jelinek <jakub at redhat.com>
++
++ Backported from mainline
++ 2017-08-09 Jakub Jelinek <jakub at redhat.com>
++
++ PR c/81687
++ * testsuite/libgomp.c/pr81687-1.c: New test.
++ * testsuite/libgomp.c/pr81687-2.c: New test.
++
++ 2017-07-27 Jakub Jelinek <jakub at redhat.com>
++
++ PR c/45784
++ * testsuite/libgomp.c/pr45784.c: New test.
++ * testsuite/libgomp.c++/pr45784.C: New test.
++
+ 2017-08-14 Release Manager
+
+ * GCC 7.2.0 released.
+Index: libgomp/testsuite/libgomp.c++/pr45784.C
+===================================================================
+--- a/src/libgomp/testsuite/libgomp.c++/pr45784.C (.../tags/gcc_7_2_0_release)
++++ b/src/libgomp/testsuite/libgomp.c++/pr45784.C (.../branches/gcc-7-branch)
+@@ -0,0 +1,5 @@
++// PR c/45784
++// { dg-do run }
++
++#include "../libgomp.c/pr45784.c"
++
+Index: libgomp/testsuite/libgomp.c/pr81687-2.c
+===================================================================
+--- a/src/libgomp/testsuite/libgomp.c/pr81687-2.c (.../tags/gcc_7_2_0_release)
++++ b/src/libgomp/testsuite/libgomp.c/pr81687-2.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,27 @@
++/* PR c/81687 */
++/* { dg-do link } */
++/* { dg-additional-options "-O2" } */
++
++int
++main ()
++{
++ __label__ lab4, lab5, lab6;
++ volatile int l = 0;
++ int m = l;
++ void foo (int x) { if (x == 1) goto lab4; }
++ void bar (int x) { if (x == 2) goto lab5; }
++ void baz (int x) { if (x == 3) goto lab6; }
++ #pragma omp parallel
++ {
++ foo (m + 1);
++ lab4:;
++ }
++ #pragma omp task
++ {
++ bar (m + 2);
++ lab5:;
++ }
++ baz (m + 3);
++ lab6:;
++ return 0;
++}
+Index: libgomp/testsuite/libgomp.c/pr45784.c
+===================================================================
+--- a/src/libgomp/testsuite/libgomp.c/pr45784.c (.../tags/gcc_7_2_0_release)
++++ b/src/libgomp/testsuite/libgomp.c/pr45784.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,41 @@
++/* PR c/45784 */
++/* { dg-do run } */
++
++void
++foo (int n)
++{
++ char *p, vla[2 * n];
++ int i;
++ #pragma omp parallel for
++ for (p = vla; p < vla + (sizeof (vla) / sizeof (vla[0])); p++)
++ *p = ' ';
++ #pragma omp parallel for
++ for (i = 0; i < 2 * n; i++)
++ if (vla[i] != ' ')
++ __builtin_abort ();
++}
++
++void
++bar (int n)
++{
++ char *p, vla1[n], vla2[n * 2], vla3[n * 3], vla4[n * 4];
++ int i;
++ __builtin_memset (vla4, ' ', n * 4);
++ #pragma omp parallel for
++ for (p = vla4 + sizeof (vla1); p < vla4 + sizeof (vla3) - sizeof (vla2) + sizeof (vla1); p += sizeof (vla4) / sizeof (vla4))
++ p[0] = '!';
++ #pragma omp parallel for
++ for (i = 0; i < n * 4; i++)
++ if (vla4[i] != ((i >= n && i < 2 * n) ? '!' : ' '))
++ __builtin_abort ();
++}
++
++int
++main ()
++{
++ volatile int n;
++ n = 128;
++ foo (n);
++ bar (n);
++ return 0;
++}
+Index: libgomp/testsuite/libgomp.c/pr81687-1.c
+===================================================================
+--- a/src/libgomp/testsuite/libgomp.c/pr81687-1.c (.../tags/gcc_7_2_0_release)
++++ b/src/libgomp/testsuite/libgomp.c/pr81687-1.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,23 @@
++/* PR c/81687 */
++/* { dg-do link } */
++/* { dg-additional-options "-O2" } */
++
++extern int printf (const char *, ...);
++
++int
++main ()
++{
++ #pragma omp parallel
++ {
++ lab1:
++ printf ("lab1=%p\n", (void *)(&&lab1));
++ }
++ lab2:
++ #pragma omp parallel
++ {
++ lab3:
++ printf ("lab2=%p\n", (void *)(&&lab2));
++ }
++ printf ("lab3=%p\n", (void *)(&&lab3));
++ return 0;
++}
+Index: libsanitizer/include/system/sys/ptrace.h
+===================================================================
+--- a/src/libsanitizer/include/system/sys/ptrace.h (.../tags/gcc_7_2_0_release)
++++ b/src/libsanitizer/include/system/sys/ptrace.h (.../branches/gcc-7-branch)
+@@ -0,0 +1,7 @@
++#include_next <sys/ptrace.h>
++#ifndef PTRACE_GETREGSET
++/* glibc before
++ https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=cbff0d9689c4d68578b6a4f0a17807232506ea27
++ doesn't define PTRACE_GETREGSET. */
++#define PTRACE_GETREGSET 0x4204
++#endif
+Index: libsanitizer/ChangeLog
+===================================================================
+--- a/src/libsanitizer/ChangeLog (.../tags/gcc_7_2_0_release)
++++ b/src/libsanitizer/ChangeLog (.../branches/gcc-7-branch)
+@@ -1,3 +1,10 @@
++2017-09-07 Jakub Jelinek <jakub at redhat.com>
++
++ Backported from mainline
++ 2017-08-07 Jakub Jelinek <jakub at redhat.com>
++
++ * include/system/sys/ptrace.h: New file.
++
+ 2017-08-14 Release Manager
+
+ * GCC 7.2.0 released.
Index: libstdc++-v3/include/std/type_traits
===================================================================
--- a/src/libstdc++-v3/include/std/type_traits (.../tags/gcc_7_2_0_release)
@@ -901,13 +1067,88 @@ Index: gcc/tree-chkp.c
&& (!DECL_FIELD_OFFSET (field)
|| TREE_CODE (DECL_FIELD_OFFSET (field)) == INTEGER_CST)
&& (!DECL_FIELD_BIT_OFFSET (field)
+Index: gcc/c-family/c-cppbuiltin.c
+===================================================================
+--- a/src/gcc/c-family/c-cppbuiltin.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/c-family/c-cppbuiltin.c (.../branches/gcc-7-branch)
+@@ -987,6 +987,8 @@
+ }
+ if (flag_new_ttp)
+ cpp_define (pfile, "__cpp_template_template_args=201611");
++ if (flag_threadsafe_statics)
++ cpp_define (pfile, "__cpp_threadsafe_static_init=200806");
+ }
+ /* Note that we define this for C as well, so that we know if
+ __attribute__((cleanup)) will interface with EH. */
+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,18 @@
++2017-09-10 Jonathan Wakely <jwakely at redhat.com>
++
++ PR c++/81852
++ * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_threadsafe_static_init.
++
++2017-09-07 Jakub Jelinek <jakub at redhat.com>
++
++ Backported from mainline
++ 2017-07-27 Jakub Jelinek <jakub at redhat.com>
++
++ PR c/45784
++ * c-omp.c (c_finish_omp_for): If the condition is wrapped in
++ rhs of COMPOUND_EXPR(s), skip them and readd their lhs into
++ new COMPOUND_EXPRs around the rhs of the comparison.
++
+ 2017-08-14 Release Manager
+
+ * GCC 7.2.0 released.
+Index: gcc/c-family/c-omp.c
+===================================================================
+--- a/src/gcc/c-family/c-omp.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/c-family/c-omp.c (.../branches/gcc-7-branch)
+@@ -531,6 +531,12 @@
+ {
+ bool cond_ok = false;
+
++ /* E.g. C sizeof (vla) could add COMPOUND_EXPRs with
++ evaluation of the vla VAR_DECL. We need to readd
++ them to the non-decl operand. See PR45784. */
++ while (TREE_CODE (cond) == COMPOUND_EXPR)
++ cond = TREE_OPERAND (cond, 1);
++
+ if (EXPR_HAS_LOCATION (cond))
+ elocus = EXPR_LOCATION (cond);
+
+@@ -605,6 +611,21 @@
+ else if (code != CILK_SIMD && code != CILK_FOR)
+ cond_ok = false;
+ }
++
++ if (cond_ok && TREE_VEC_ELT (condv, i) != cond)
++ {
++ tree ce = NULL_TREE, *pce = &ce;
++ tree type = TREE_TYPE (TREE_OPERAND (cond, 1));
++ for (tree c = TREE_VEC_ELT (condv, i); c != cond;
++ c = TREE_OPERAND (c, 1))
++ {
++ *pce = build2 (COMPOUND_EXPR, type, TREE_OPERAND (c, 0),
++ TREE_OPERAND (cond, 1));
++ pce = &TREE_OPERAND (*pce, 1);
++ }
++ TREE_OPERAND (cond, 1) = ce;
++ TREE_VEC_ELT (condv, i) = cond;
++ }
+ }
+
+ if (!cond_ok)
Index: gcc/DATESTAMP
===================================================================
--- a/src/gcc/DATESTAMP (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/DATESTAMP (.../branches/gcc-7-branch)
@@ -1 +1 @@
-20170814
-+20170906
++20170912
Index: gcc/tree.c
===================================================================
--- a/src/gcc/tree.c (.../tags/gcc_7_2_0_release)
@@ -1143,6 +1384,52 @@ Index: gcc/fold-const.c
return NULL_TREE;
if (minus_lit0)
+Index: gcc/omp-low.c
+===================================================================
+--- a/src/gcc/omp-low.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/omp-low.c (.../branches/gcc-7-branch)
+@@ -800,6 +800,8 @@
+
+ if (TREE_CODE (var) == LABEL_DECL)
+ {
++ if (FORCED_LABEL (var) || DECL_NONLOCAL (var))
++ return var;
+ new_var = create_artificial_label (DECL_SOURCE_LOCATION (var));
+ DECL_CONTEXT (new_var) = current_function_decl;
+ insert_decl_map (&ctx->cb, var, new_var);
+@@ -6925,10 +6927,14 @@
+ rhs_p = gimple_omp_for_initial_ptr (stmt, i);
+ if (!is_gimple_min_invariant (*rhs_p))
+ *rhs_p = get_formal_tmp_var (*rhs_p, &body);
++ else if (TREE_CODE (*rhs_p) == ADDR_EXPR)
++ recompute_tree_invariant_for_addr_expr (*rhs_p);
+
+ rhs_p = gimple_omp_for_final_ptr (stmt, i);
+ if (!is_gimple_min_invariant (*rhs_p))
+ *rhs_p = get_formal_tmp_var (*rhs_p, &body);
++ else if (TREE_CODE (*rhs_p) == ADDR_EXPR)
++ recompute_tree_invariant_for_addr_expr (*rhs_p);
+
+ rhs_p = &TREE_OPERAND (gimple_omp_for_incr (stmt, i), 1);
+ if (!is_gimple_min_invariant (*rhs_p))
+@@ -9089,7 +9095,7 @@
+ }
+ if (kind == NULL)
+ {
+- gcc_checking_assert (flag_openmp);
++ gcc_checking_assert (flag_openmp || flag_openmp_simd);
+ kind = "OpenMP";
+ }
+
+@@ -9349,7 +9355,7 @@
+ /* opt_pass methods: */
+ virtual bool gate (function *)
+ {
+- return flag_cilkplus || flag_openacc || flag_openmp;
++ return flag_cilkplus || flag_openacc || flag_openmp || flag_openmp_simd;
+ }
+ virtual unsigned int execute (function *)
+ {
Index: gcc/tree-ssa-sccvn.c
===================================================================
--- a/src/gcc/tree-ssa-sccvn.c (.../tags/gcc_7_2_0_release)
@@ -1160,7 +1447,97 @@ Index: gcc/ChangeLog
===================================================================
--- a/src/gcc/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,254 @@
+@@ -1,3 +1,344 @@
++2017-09-11 Max Filippov <jcmvbkbc at gmail.com>
++
++ Backport from mainline
++ PR target/82181
++ * config/xtensa/xtensa.c (xtensa_mem_offset): Check that both
++ words of DImode object are reachable by xtensa_uimm8x4 access.
++
++2017-09-10 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2017-05-11 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR target/80695
++ * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost):
++ Account for direct move costs for vec_construct of integer
++ vectors.
++
++ Backport from mainline
++ 2017-07-23 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR target/80695
++ * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost):
++ Reduce cost estimate for direct moves.
++
++2017-09-08 Eric Botcazou <ebotcazou at adacore.com>
++
++ PR target/81988
++ * config/sparc/sparc.md (mulsi3): Rename into *mulsi3_sp32.
++ (*mulsi3_sp64): New instruction.
++ (mulsi3): New expander.
++
++2017-09-07 Jakub Jelinek <jakub at redhat.com>
++
++ Backported from mainline
++ 2017-09-05 Jakub Jelinek <jakub at redhat.com>
++
++ PR middle-end/81768
++ * omp-low.c (lower_omp_for): Recompute tree invariant if
++ gimple_omp_for_initial/final is ADDR_EXPR.
++
++ PR middle-end/81768
++ * omp-expand.c (expand_omp_simd): Force second operands of COND_EXPR
++ into gimple val before gimplification fo the COND_EXPR.
++
++ 2017-09-04 Jakub Jelinek <jakub at redhat.com>
++
++ * lra-remat.c (reg_overlap_for_remat_p): Fix a pasto.
++
++ 2017-09-01 Jakub Jelinek <jakub at redhat.com>
++
++ PR sanitizer/81923
++ * asan.c (create_odr_indicator): Strip name encoding from assembler
++ name before appending it after __odr_asan_.
++
++ 2017-08-09 Jakub Jelinek <jakub at redhat.com>
++
++ PR c/81687
++ * omp-low.c (omp_copy_decl): Don't remap FORCED_LABEL or DECL_NONLOCAL
++ LABEL_DECLs.
++ * tree-cfg.c (move_stmt_op): Don't adjust DECL_CONTEXT of FORCED_LABEL
++ or DECL_NONLOCAL labels.
++ (move_stmt_r) <case GIMPLE_LABEL>: Adjust DECL_CONTEXT of FORCED_LABEL
++ or DECL_NONLOCAL labels here.
++
++ 2017-08-03 Jakub Jelinek <jakub at redhat.com>
++
++ PR target/81621
++ * bb-reorder.c (pass_partition_blocks::execute): Return TODO_df_finish
++ after setting changeable df flags.
++
++ PR driver/81650
++ * calls.c (alloc_max_size): Use HOST_WIDE_INT_UC (10??)
++ instead of 10??LU, perform unit multiplication in wide_int,
++ don't change alloc_object_size_limit if the limit is larger
++ than SSIZE_MAX.
++
++ PR middle-end/81052
++ * omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
++ (pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.
++
++2017-09-06 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline:
++ 2017-08-30 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/81987
++ * gimple-ssa-strength-reduction.c (insert_initializers): Don't
++ insert an initializer in a location not dominated by the stride
++ definition.
++
+2017-09-05 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
+
+ Backport from mainline
@@ -1819,6 +2196,52 @@ Index: gcc/testsuite/gcc.target/powerpc/vec-setup-be-double.c
+#define DO_DOUBLE
+
+#include "vec-setup.h"
+Index: gcc/testsuite/gcc.target/powerpc/pr80695-p8.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/powerpc/pr80695-p8.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/powerpc/pr80695-p8.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,18 @@
++/* { dg-do compile { target { powerpc*-*-* } } } */
++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
++/* { dg-require-effective-target vect_int } */
++/* { dg-options "-mcpu=power8 -O3 -fdump-tree-slp-details" } */
++
++/* PR80695: Verify cost model for vec_construct on POWER8. */
++
++long a[10] __attribute__((aligned(16)));
++
++void foo (long i, long j, long k, long l)
++{
++ a[6] = i;
++ a[7] = j;
++ a[8] = k;
++ a[9] = l;
++}
++
++/* { dg-final { scan-tree-dump-times "vectorization is not profitable" 1 "slp2" } } */
+Index: gcc/testsuite/gcc.target/powerpc/pr80695-p9.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/powerpc/pr80695-p9.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/powerpc/pr80695-p9.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,18 @@
++/* { dg-do compile { target { powerpc*-*-* } } } */
++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
++/* { dg-require-effective-target vect_int } */
++/* { dg-options "-mcpu=power9 -O3 -fdump-tree-slp-details" } */
++
++/* PR80695: Verify cost model for vec_construct on POWER9. */
++
++long a[10] __attribute__((aligned(16)));
++
++void foo (long i, long j, long k, long l)
++{
++ a[6] = i;
++ a[7] = j;
++ a[8] = k;
++ a[9] = l;
++}
++
++/* { dg-final { scan-tree-dump-times "vectorization is not profitable" 1 "slp2" } } */
Index: gcc/testsuite/gcc.target/powerpc/vsx-extract-6.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/powerpc/vsx-extract-6.c (.../tags/gcc_7_2_0_release)
@@ -2646,6 +3069,39 @@ Index: gcc/testsuite/gnat.dg/incomplete5.ads
+ end record;
+
+end Incomplete5;
+Index: gcc/testsuite/gnat.dg/pack9.adb
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/pack9.adb (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/pack9.adb (.../branches/gcc-7-branch)
+@@ -1,7 +1,8 @@
+ -- { dg-do compile }
+ -- { dg-options "-O2 -gnatp -fdump-tree-optimized" }
+--- See PR tree-optimization/46801 for the expected failure
+
++pragma Optimize_Alignment (Space);
++
+ package body Pack9 is
+
+ procedure Copy (X, Y : R2_Ptr) is
+Index: gcc/testsuite/gnat.dg/specs/vfa.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/specs/vfa.ads (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/specs/vfa.ads (.../branches/gcc-7-branch)
+@@ -1,14 +0,0 @@
+--- { dg-do compile }
+--- { dg-options "-g" }
+-
+-package VFA is
+-
+- type Rec is record
+- A : Short_Integer;
+- B : Short_Integer;
+- end record;
+-
+- type Rec_VFA is new Rec;
+- pragma Volatile_Full_Access (Rec_VFA);
+-
+-end VFA;
Index: gcc/testsuite/gnat.dg/specs/uc2.ads
===================================================================
--- a/src/gcc/testsuite/gnat.dg/specs/uc2.ads (.../tags/gcc_7_2_0_release)
@@ -2669,6 +3125,243 @@ Index: gcc/testsuite/gnat.dg/specs/uc2.ads
+ W : Word_Type := Conv(A);
+
+end UC2;
+Index: gcc/testsuite/gnat.dg/specs/vfa2.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/specs/vfa2.ads (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/specs/vfa2.ads (.../branches/gcc-7-branch)
+@@ -0,0 +1,110 @@
++-- { dg-do compile }
++-- { dg-options "-O" }
++
++package VFA2 is
++
++ type Bit is mod 2**1
++ with Size => 1;
++ type UInt2 is mod 2**2
++ with Size => 2;
++ type UInt22 is mod 2**22
++ with Size => 22;
++
++ type MODE_ENUM is
++ (
++ Function_0_Default,
++ Function_1,
++ Function_2,
++ Function_3,
++ Function_4,
++ Function_5,
++ Function_6,
++ Function_7)
++ with Size => 3;
++
++ type EPD_ENUM is
++ (
++ Disable_Pull_Down,
++ Enable_Pull_Down)
++ with Size => 1;
++
++ type EPUN_ENUM is
++ (
++ Enable_Pull_Up,
++ Disable_Pull_Up)
++ with Size => 1;
++
++ type EHS_ENUM is
++ (
++ Slow_Low_Noise_With,
++ Fast_Medium_Noise_W)
++ with Size => 1;
++
++ type EZI_ENUM is
++ (
++ Disable_Input_Buffer,
++ Enable_Input_Buffer)
++ with Size => 1;
++
++ type ZIF_ENUM is
++ (
++ Enable_Input_Glitch,
++ Disable_Input_Glitch)
++ with Size => 1;
++
++ type EHD_ENUM is
++ (
++ Normal_Drive_4_Ma_D,
++ Medium_Drive_8_Ma_D,
++ High_Drive_14_Ma_Dr,
++ Ultra_High_Drive_20)
++ with Size => 2;
++
++ type Pin_Type is (Normal_Drive, High_Drive, High_Speed);
++
++ type SFS_Register(Pin : Pin_Type := Normal_Drive) is record
++ MODE : MODE_ENUM;
++ EPD : EPD_ENUM;
++ EPUN : EPUN_ENUM;
++ EZI : EZI_ENUM;
++ ZIF : ZIF_ENUM;
++ RESERVED : UInt22;
++
++ case Pin is
++ when Normal_Drive =>
++
++ ND_EHS_RESERVED : Bit;
++ ND_EHD_RESERVED : UInt2;
++
++ when High_Drive =>
++
++ EHD : EHD_ENUM;
++ HD_EHS_RESERVED : Bit;
++
++ when High_Speed =>
++ EHS : EHS_ENUM;
++ HS_EHD_RESERVED : UInt2;
++
++ end case;
++ end record
++ with Unchecked_Union, Size => 32, Volatile_Full_Access;
++
++ for SFS_Register use record
++ MODE at 0 range 0 .. 2;
++ EPD at 0 range 3 .. 3;
++ EPUN at 0 range 4 .. 4;
++ ND_EHS_RESERVED at 0 range 5 .. 5;
++ HD_EHS_RESERVED at 0 range 5 .. 5;
++ EHS at 0 range 5 .. 5;
++ EZI at 0 range 6 .. 6;
++ ZIF at 0 range 7 .. 7;
++ ND_EHD_RESERVED at 0 range 8 .. 9;
++ EHD at 0 range 8 .. 9;
++ HS_EHD_RESERVED at 0 range 8 .. 9;
++ RESERVED at 0 range 10 .. 31;
++ end record;
++
++ type Normal_Drive_Pins is array (Integer range <>)
++ of SFS_Register(Normal_Drive) with Volatile;
++
++end VFA2;
+Index: gcc/testsuite/gnat.dg/specs/atomic3.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/specs/atomic3.ads (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/specs/atomic3.ads (.../branches/gcc-7-branch)
+@@ -0,0 +1,33 @@
++-- { dg-do compile }
++
++package Atomic3 is
++
++ type Four_Bits is mod 2**4;
++ type Fourteen_Bits is mod 2**14;
++ type Twenty_Eight_Bits is mod 2**28;
++
++ type Rec1 (Mode : Boolean := True) is record
++ Reserved : Four_Bits;
++ case Mode is
++ when True =>
++ High_Part : Fourteen_Bits;
++ Low_Part : Fourteen_Bits;
++ when False =>
++ Data : Twenty_Eight_Bits;
++ end case;
++ end record;
++ for Rec1 use record
++ Reserved at 0 range 28 .. 31;
++ High_Part at 0 range 14 .. 27;
++ Low_Part at 0 range 0 .. 13;
++ Data at 0 range 0 .. 27;
++ end record;
++ for Rec1'Size use 32;
++ pragma Unchecked_Union (Rec1);
++
++ type Rec2 is record
++ A : Rec1;
++ pragma Atomic (A);
++ end record;
++
++end Atomic3;
+Index: gcc/testsuite/gnat.dg/specs/vfa1.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/specs/vfa1.ads (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/specs/vfa1.ads (.../branches/gcc-7-branch)
+@@ -0,0 +1,14 @@
++-- { dg-do compile }
++-- { dg-options "-g" }
++
++package VFA1 is
++
++ type Rec is record
++ A : Short_Integer;
++ B : Short_Integer;
++ end record;
++
++ type Rec_VFA is new Rec;
++ pragma Volatile_Full_Access (Rec_VFA);
++
++end VFA1;
+Index: gcc/testsuite/gcc.dg/gomp/pr81768-2.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/gomp/pr81768-2.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/gomp/pr81768-2.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,15 @@
++/* PR middle-end/81768 */
++/* { dg-do compile } */
++
++float b[10][15][10];
++
++void
++foo (void)
++{
++ float *i;
++#pragma omp target parallel for schedule(static, 32) collapse(3)
++ for (i = &b[0][0][0]; i < &b[0][0][10]; i++)
++ for (float *j = &b[0][15][0]; j > &b[0][0][0]; j -= 10)
++ for (float *k = &b[0][0][10]; k > &b[0][0][0]; --k)
++ b[i - &b[0][0][0]][(j - &b[0][0][0]) / 10 - 1][(k - &b[0][0][0]) - 1] -= 3.5;
++}
+Index: gcc/testsuite/gcc.dg/gomp/pr81768-1.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/gomp/pr81768-1.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/gomp/pr81768-1.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,15 @@
++/* PR middle-end/81768 */
++/* { dg-do compile } */
++
++float b[10][15][10];
++
++void
++foo (void)
++{
++ float *i;
++#pragma omp target parallel for simd schedule(static, 32) collapse(3)
++ for (i = &b[0][0][0]; i < &b[0][0][10]; i++)
++ for (float *j = &b[0][15][0]; j > &b[0][0][0]; j -= 10)
++ for (float *k = &b[0][0][10]; k > &b[0][0][0]; --k)
++ b[i - &b[0][0][0]][(j - &b[0][0][0]) / 10 - 1][(k - &b[0][0][0]) - 1] -= 3.5;
++}
+Index: gcc/testsuite/gcc.dg/asan/pr81923.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/asan/pr81923.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/asan/pr81923.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,10 @@
++/* PR sanitizer/81923 */
++/* { dg-do link } */
++
++int foobar __asm (__USER_LABEL_PREFIX__ "barbaz") = 34;
++
++int
++main ()
++{
++ return 0;
++}
+Index: gcc/testsuite/gcc.dg/pr81621.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/pr81621.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/pr81621.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,5 @@
++/* PR target/81621 */
++/* { dg-do compile { target freorder } } */
++/* { dg-options "-Og -fno-split-wide-types -freorder-blocks-and-partition" } */
++
++#include "graphite/scop-10.c"
Index: gcc/testsuite/gcc.dg/torture/pr81181.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/torture/pr81181.c (.../tags/gcc_7_2_0_release)
@@ -2704,6 +3397,58 @@ Index: gcc/testsuite/gcc.dg/torture/pr81181.c
+
+ goto oo;
+}
+Index: gcc/testsuite/gcc.dg/pr81650.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/pr81650.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/pr81650.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,9 @@
++/* PR driver/81650 */
++/* { dg-do compile } */
++/* { dg-options "-Walloc-size-larger-than=9223372036854775807" } */
++
++void *
++foo (void)
++{
++ return __builtin_malloc (5);
++}
+Index: gcc/testsuite/gcc.dg/tree-ssa/pr81588.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr81588.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr81588.c (.../branches/gcc-7-branch)
+@@ -1,5 +1,5 @@
+ /* PR tree-optimization/81588 */
+-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*" } } } */
++/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! "mips*-*-* avr-*-* s390*-*-*" } } || { m68k*-*-* bfin*-*-* v850*-*-* moxie*-*-* m32c*-*-* fr30*-*-* mcore*-*-* xtensa*-*-* hppa*-*-* } } } } } */
+ /* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
+ /* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+Index: gcc/testsuite/gcc.dg/pr81988.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/pr81988.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/pr81988.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,22 @@
++/* PR target/81988 */
++/* Testcase by James Cowgill <jcowgill+gcc at jcowgill.uk> */
++
++/* { dg-do assemble } */
++/* { dg-require-effective-target pie } */
++/* { dg-options "-O3 -fpie" } */
++
++int c, d;
++
++short **e;
++int *a;
++
++void foo(void)
++{
++ int g[64 * 35], *h = g;
++ do {
++ short *f = e[d];
++ for (int i = 0; i < 4; i++)
++ a[i] = a[i] + (h[364] + f[4] * h[64] + f[5] * h[i] + f[6] * h[i + 3 * 4] +
++ f[7] * h[i + 4]);
++ } while (c);
++}
Index: gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c (.../tags/gcc_7_2_0_release)
@@ -2718,7 +3463,85 @@ 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,190 @@
+@@ -1,3 +1,268 @@
++2017-09-10 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2017-05-11 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR target/80695
++ * gcc.target/powerpc/pr80695-p8.c: New file.
++ * gcc.target/powerpc/pr80695-p9.c: New file.
++
++2017-09-10 Eric Botcazou <ebotcazou at adacore.com>
++
++ PR ada/79441
++ * gnat.dg/pack9.adb: Robustify.
++
++2017-09-10 Jonathan Wakely <jwakely at redhat.com>
++
++ PR c++/81852
++ * g++.dg/cpp1y/feat-cxx11.C: Check __cpp_threadsafe_static_init.
++ * g++.dg/cpp1y/feat-cxx14.C: Likewise.
++ * g++.dg/cpp1y/feat-cxx98.C: Likewise.
++ * g++.dg/cpp1y/feat-neg.C: Likewise.
++ * g++.dg/cpp1z/feat-cxx1z.C: Likewise.
++
++2017-09-09 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gnat.dg/specs/atomic3.ads: New test.
++
++2017-09-09 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gnat.dg/specs/vfa.ads: Rename into...
++ * gnat.dg/specs/vfa1.ads: ...this.
++ * gnat.dg/specs/vfa2.ads: New test.
++
++2017-09-08 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gcc.dg/pr81988.c: New test.
++
++2017-09-07 Jakub Jelinek <jakub at redhat.com>
++
++ Backported from mainline
++ 2017-09-05 Jakub Jelinek <jakub at redhat.com>
++
++ PR middle-end/81768
++ * gcc.dg/gomp/pr81768-2.c: New test.
++
++ PR middle-end/81768
++ * gcc.dg/gomp/pr81768-1.c: New test.
++
++ 2017-09-01 Jakub Jelinek <jakub at redhat.com>
++
++ PR sanitizer/81923
++ * gcc.dg/asan/pr81923.c: New test.
++
++ 2017-08-03 Jakub Jelinek <jakub at redhat.com>
++
++ PR target/81621
++ * gcc.dg/pr81621.c: New test.
++
++ PR driver/81650
++ * gcc.dg/pr81650.c: New test.
++
++ PR middle-end/81052
++ * c-c++-common/pr81052.c: New test.
++
++2017-09-06 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline:
++ 2017-08-30 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/81987
++ * g++.dg/torture/pr81987.C: New file.
++
++2017-09-06 Jakub Jelinek <jakub at redhat.com>
++
++ PR testsuite/82120
++ * gcc.dg/tree-ssa/pr81588.c: Don't run on logical_op_short_circuit
++ targets except for those where -mbranch-cost=2 is supported.
++
+2017-09-05 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
+
+ Backport from mainline
@@ -3042,6 +3865,163 @@ Index: gcc/testsuite/g++.dg/torture/pr81977.C
+ __builtin_abort ();
+ delete [] buffer;
+}
+Index: gcc/testsuite/g++.dg/torture/pr81987.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/torture/pr81987.C (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/torture/pr81987.C (.../branches/gcc-7-branch)
+@@ -0,0 +1,61 @@
++extern short var_1;
++extern const short var_3;
++extern unsigned long int var_9;
++extern short var_13;
++extern const unsigned long int var_15;
++extern const unsigned long int var_37;
++extern unsigned long int var_40;
++extern long long int var_47;
++extern short var_48;
++extern const short var_54;
++extern long long int var_79;
++extern long long int var_81;
++extern long long int var_94;
++extern long long int var_95;
++extern long long int var_701;
++extern unsigned long int var_786;
++extern short var_788;
++extern long long int var_844;
++
++struct struct_1 {
++ short member_1_2 : 15;
++ static long long int member_1_3;
++};
++
++extern struct_1 struct_obj_6;
++extern struct_1 struct_obj_8;
++
++void foo() {
++ int a = var_3 <= 602154393864UL;
++ if (var_81 ? 0 : var_3 && var_9)
++ ;
++ else {
++ var_94 = 0;
++ if (var_3 && var_48 || var_13) {
++ if (var_48)
++ var_95 = 0;
++ short b((2364461588881776511UL + var_3) * (2 ? var_13 : 0) || var_1);
++ struct_obj_8.member_1_2 = b;
++ if (var_15) {
++ if (var_81)
++ if (var_47)
++ ;
++ else if (var_40)
++ var_701 = 0;
++ } else {
++ if (var_40)
++ var_79 = 0;
++ if (var_54) {
++ if (var_37)
++ var_786 = 0;
++ else
++ var_788 = 0;
++ struct_obj_6.member_1_3 =
++ (2364461588881776511UL + var_3) * (2 ? var_13 : 0);
++ }
++ }
++ if ((2364461588881776511UL + var_3) * (2 ? var_13 : 0))
++ var_844 = 0;
++ }
++ }
++}
+Index: gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C (.../branches/gcc-7-branch)
+@@ -125,6 +125,12 @@
+ # error "__cpp_alias_templates != 200704"
+ #endif
+
++#ifndef __cpp_threadsafe_static_init
++# error "__cpp_threadsafe_static_init"
++#elif __cpp_threadsafe_static_init != 200806
++# error "__cpp_threadsafe_static_init != 200806"
++#endif
++
+ // C++14 features allowed in C++11 in non-ANSI modes:
+
+ #ifndef __cpp_binary_literals
+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)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C (.../branches/gcc-7-branch)
+@@ -118,6 +118,12 @@
+ # error "__cpp_alias_templates != 200704"
+ #endif
+
++#ifndef __cpp_threadsafe_static_init
++# error "__cpp_threadsafe_static_init"
++#elif __cpp_threadsafe_static_init != 200806
++# error "__cpp_threadsafe_static_init != 200806"
++#endif
++
+ // C++14 features:
+
+ #ifndef __cpp_binary_literals
+Index: gcc/testsuite/g++.dg/cpp1y/feat-cxx98.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/feat-cxx98.C (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/feat-cxx98.C (.../branches/gcc-7-branch)
+@@ -15,6 +15,14 @@
+ # error "__cpp_exceptions != 199711"
+ #endif
+
++// C++11 features allowed in C++98:
++
++#ifndef __cpp_threadsafe_static_init
++# error "__cpp_threadsafe_static_init"
++#elif __cpp_threadsafe_static_init != 200806
++# error "__cpp_threadsafe_static_init != 200806"
++#endif
++
+ // C++14 features allowed in C++98 in non-ANSI modes:
+
+ #ifndef __cpp_binary_literals
+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)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/feat-neg.C (.../branches/gcc-7-branch)
+@@ -1,5 +1,5 @@
+ // { dg-do compile }
+-// { dg-options "-fno-rtti -fno-exceptions" }
++// { dg-options "-fno-rtti -fno-exceptions -fno-threadsafe-statics" }
+
+ // C++98 features with explicit opt-out:
+
+@@ -10,3 +10,9 @@
+ #ifndef __cpp_exceptions
+ # error "__cpp_exceptions" // { dg-error "error" }
+ #endif
++
++// C++11 features with explicit opt-out:
++
++#ifndef __cpp_threadsafe_static_init
++# error "__cpp_threadsafe_static_init" // { dg-error "error" }
++#endif
+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)
++++ b/src/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C (.../branches/gcc-7-branch)
+@@ -106,6 +106,12 @@
+ # error "__cpp_alias_templates != 200704"
+ #endif
+
++#ifndef __cpp_threadsafe_static_init
++# error "__cpp_threadsafe_static_init"
++#elif __cpp_threadsafe_static_init != 200806
++# error "__cpp_threadsafe_static_init != 200806"
++#endif
++
+ // C++14 features:
+
+ #ifndef __cpp_binary_literals
Index: gcc/testsuite/g++.dg/pr80287.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/pr80287.C (.../tags/gcc_7_2_0_release)
@@ -3146,6 +4126,39 @@ Index: gcc/testsuite/c-c++-common/ubsan/pr81088.c
+ i = -(s + (int)(~(unsigned)(0 / y))) + 0x7fffffff;
+ return 0;
+}
+Index: gcc/testsuite/c-c++-common/pr81052.c
+===================================================================
+--- a/src/gcc/testsuite/c-c++-common/pr81052.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/c-c++-common/pr81052.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,28 @@
++/* PR middle-end/81052 */
++/* { dg-do compile } */
++/* { dg-options "-fopenmp-simd -O2" } */
++
++int
++foo (int x, int y)
++{
++ int i;
++#pragma omp simd
++ for (i = x; i < y; ++i)
++ return 0; /* { dg-error "invalid branch to/from OpenMP structured block" } */
++ return 1;
++}
++
++#ifdef __cplusplus
++template <typename T>
++T
++bar (T x, T y)
++{
++ T i;
++#pragma omp simd
++ for (i = x; i < y; ++i)
++ return 0; /* { dg-error "invalid branch to/from OpenMP structured block" "" { target c++ } } */
++ return 1;
++}
++
++int x = bar (1, 7);
++#endif
Index: gcc/cp/typeck.c
===================================================================
--- a/src/gcc/cp/typeck.c (.../tags/gcc_7_2_0_release)
@@ -3162,7 +4175,14 @@ 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,21 @@
+@@ -1,3 +1,28 @@
++2017-09-09 Eric Botcazou <ebotcazou at adacore.com>
++
++ PR bootstrap/81926
++ * cp-objcp-common.c (struct debug_type_hasher): New class.
++ (debug_type_hash): New variable.
++ (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
++
+2017-09-01 Marek Polacek <polacek at redhat.com>
+
+ Backported from mainline
@@ -3184,7 +4204,7 @@ Index: gcc/cp/ChangeLog
2017-08-14 Release Manager
* GCC 7.2.0 released.
-@@ -4,8 +22,8 @@
+@@ -4,8 +29,8 @@
2017-08-09 Leonid Koppel <lkoppel at uwaterloo.ca>
@@ -3212,6 +4232,108 @@ Index: gcc/cp/cp-gimplify.c
break;
+Index: gcc/cp/cp-objcp-common.c
+===================================================================
+--- a/src/gcc/cp/cp-objcp-common.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/cp/cp-objcp-common.c (.../branches/gcc-7-branch)
+@@ -131,6 +131,20 @@
+ return same_type_ignoring_top_level_qualifiers_p (x, y);
+ }
+
++struct debug_type_hasher : ggc_cache_ptr_hash<tree_map>
++{
++ static hashval_t hash (tree_map *m) { return tree_map_hash (m); }
++ static bool equal (tree_map *a, tree_map *b) { return tree_map_eq (a, b); }
++
++ static int
++ keep_cache_entry (tree_map *&e)
++ {
++ return ggc_marked_p (e->base.from);
++ }
++};
++
++static GTY((cache)) hash_table<debug_type_hasher> *debug_type_hash;
++
+ /* Return a type to use in the debug info instead of TYPE, or NULL_TREE to
+ keep TYPE. */
+
+@@ -138,9 +152,36 @@
+ cp_get_debug_type (const_tree type)
+ {
+ if (TYPE_PTRMEMFUNC_P (type) && !typedef_variant_p (type))
+- return build_offset_type (TYPE_PTRMEMFUNC_OBJECT_TYPE (type),
+- TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)));
++ {
++ if (debug_type_hash == NULL)
++ debug_type_hash = hash_table<debug_type_hasher>::create_ggc (512);
+
++ /* We cannot simply use build_offset_type here because the function uses
++ the type canonicalization hashtable, which is GC-ed, so its behavior
++ depends on the actual collection points. Since we are building these
++ types on the fly for the debug info only, they would not be attached
++ to any GC root and always be swept, so we would make the contents of
++ the debug info depend on the collection points. */
++ struct tree_map in, *h;
++
++ in.base.from = CONST_CAST_TREE (type);
++ in.hash = htab_hash_pointer (type);
++ h = debug_type_hash->find_with_hash (&in, in.hash);
++ if (h)
++ return h->to;
++
++ tree t = build_offset_type (TYPE_PTRMEMFUNC_OBJECT_TYPE (type),
++ TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)));
++
++ h = ggc_alloc<tree_map> ();
++ h->base.from = CONST_CAST_TREE (type);
++ h->hash = htab_hash_pointer (type);
++ h->to = t;
++ *debug_type_hash->find_slot_with_hash (h, h->hash, INSERT) = h;
++
++ return t;
++ }
++
+ return NULL_TREE;
+ }
+
+Index: gcc/omp-expand.c
+===================================================================
+--- a/src/gcc/omp-expand.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/omp-expand.c (.../branches/gcc-7-branch)
+@@ -4725,12 +4725,14 @@
+ tree itype2 = TREE_TYPE (fd->loops[i - 1].v);
+ if (POINTER_TYPE_P (itype2))
+ itype2 = signed_type_for (itype2);
++ t = fold_convert (itype2, fd->loops[i - 1].step);
++ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true,
++ GSI_SAME_STMT);
+ t = build3 (COND_EXPR, itype2,
+ build2 (fd->loops[i].cond_code, boolean_type_node,
+ fd->loops[i].v,
+ fold_convert (itype, fd->loops[i].n2)),
+- build_int_cst (itype2, 0),
+- fold_convert (itype2, fd->loops[i - 1].step));
++ build_int_cst (itype2, 0), t);
+ if (POINTER_TYPE_P (TREE_TYPE (fd->loops[i - 1].v)))
+ t = fold_build_pointer_plus (fd->loops[i - 1].v, t);
+ else
+@@ -4737,12 +4739,14 @@
+ t = fold_build2 (PLUS_EXPR, itype2, fd->loops[i - 1].v, t);
+ expand_omp_build_assign (&gsi, fd->loops[i - 1].v, t);
+
++ t = fold_convert (itype, fd->loops[i].n1);
++ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true,
++ GSI_SAME_STMT);
+ t = build3 (COND_EXPR, itype,
+ build2 (fd->loops[i].cond_code, boolean_type_node,
+ fd->loops[i].v,
+ fold_convert (itype, fd->loops[i].n2)),
+- fd->loops[i].v,
+- fold_convert (itype, fd->loops[i].n1));
++ fd->loops[i].v, t);
+ expand_omp_build_assign (&gsi, fd->loops[i].v, t);
+ }
+ }
Index: gcc/tree-ssa-alias.c
===================================================================
--- a/src/gcc/tree-ssa-alias.c (.../tags/gcc_7_2_0_release)
@@ -3484,11 +4606,94 @@ Index: gcc/dwarf2out.c
{
dw_loc_descr_ref loc = NULL;
if (! early_dwarf
+Index: gcc/ada/sem_ch3.adb
+===================================================================
+--- a/src/gcc/ada/sem_ch3.adb (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/ada/sem_ch3.adb (.../branches/gcc-7-branch)
+@@ -21211,9 +21211,11 @@
+ Error_Msg_N ("invalid subtype mark in subtype indication", S);
+ end case;
+
+- -- Size and Convention are always inherited from the base type
++ -- Size, Alignment, Representation aspects and Convention are always
++ -- inherited from the base type.
+
+ Set_Size_Info (Def_Id, (Subtype_Mark_Id));
++ Set_Rep_Info (Def_Id, (Subtype_Mark_Id));
+ Set_Convention (Def_Id, Convention (Subtype_Mark_Id));
+
+ return Def_Id;
+Index: gcc/ada/sem_util.adb
+===================================================================
+--- a/src/gcc/ada/sem_util.adb (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/ada/sem_util.adb (.../branches/gcc-7-branch)
+@@ -20302,6 +20302,20 @@
+ end if;
+ end Set_Referenced_Modified;
+
++ ------------------
++ -- Set_Rep_Info --
++ ------------------
++
++ procedure Set_Rep_Info (T1, T2 : Entity_Id) is
++ begin
++ Set_Is_Atomic (T1, Is_Atomic (T2));
++ Set_Is_Independent (T1, Is_Independent (T2));
++ Set_Is_Volatile_Full_Access (T1, Is_Volatile_Full_Access (T2));
++ if Is_Base_Type (T1) then
++ Set_Is_Volatile (T1, Is_Volatile (T2));
++ end if;
++ end Set_Rep_Info;
++
+ ----------------------------
+ -- Set_Scope_Is_Transient --
+ ----------------------------
+Index: gcc/ada/sem_util.ads
+===================================================================
+--- a/src/gcc/ada/sem_util.ads (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/ada/sem_util.ads (.../branches/gcc-7-branch)
+@@ -2313,6 +2313,12 @@
+ -- (Referenced_As_LHS if Out_Param is False, Referenced_As_Out_Parameter
+ -- if Out_Param is True) is set True, and the other flag set False.
+
++ procedure Set_Rep_Info (T1, T2 : Entity_Id);
++ pragma Inline (Set_Rep_Info);
++ -- Copies the Is_Atomic, Is_Independent and Is_Volatile_Full_Access flags
++ -- from sub(type) entity T2 to (sub)type entity T1, as well as Is_Volatile
++ -- if T1 is a base type.
++
+ procedure Set_Scope_Is_Transient (V : Boolean := True);
+ -- Set the flag Is_Transient of the current scope
+
Index: gcc/ada/ChangeLog
===================================================================
--- a/src/gcc/ada/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/ada/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,26 @@
+@@ -1,3 +1,50 @@
++2017-09-09 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gcc-interface/decl.c (promote_object_alignment): New function taken
++ from...
++ (gnat_to_gnu_entity) <E_Variable>: ...here. Invoke it.
++ (gnat_to_gnu_field): If the field is Atomic or VFA, invoke it and
++ create a padding type on success before doing the atomic check.
++
++2017-09-09 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Apply the
++ promotion to static memory earlier in the processing.
++
++2017-09-09 Eric Botcazou <ebotcazou at adacore.com>
++
++ * sem_util.ads (Set_Rep_Info): New inline procedure.
++ * sem_util.adb (Set_Rep_Info): Implement it.
++ * sem_ch3.adb (Process_Subtype): If the case of a constraint present,
++ always copy the representation aspects onto the subtype.
++ * gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK
++ and TYPE_BY_REFERENCE_P flags on types after various promotions.
++ * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
++ Consider all kinds of entities.
++
+2017-09-05 Eric Botcazou <ebotcazou at adacore.com>
+
+ PR ada/62235
@@ -3564,7 +4769,15 @@ Index: gcc/ada/gcc-interface/decl.c
===================================================================
--- a/src/gcc/ada/gcc-interface/decl.c (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/ada/gcc-interface/decl.c (.../branches/gcc-7-branch)
-@@ -309,11 +309,14 @@
+@@ -229,6 +229,7 @@
+ static tree validate_size (Uint, tree, Entity_Id, enum tree_code, bool, bool);
+ static void set_rm_size (Uint, tree, Entity_Id);
+ static unsigned int validate_alignment (Uint, Entity_Id, unsigned int);
++static unsigned int promote_object_alignment (tree, Entity_Id);
+ static void check_ok_for_atomic_type (tree, Entity_Id, bool);
+ static tree create_field_decl_from (tree, tree, tree, tree, tree,
+ vec<subst_pair> );
+@@ -309,11 +310,14 @@
/* Since a use of an Itype is a definition, process it as such if it is in
the main unit, except for E_Access_Subtype because it's actually a use
@@ -3581,7 +4794,94 @@ Index: gcc/ada/gcc-interface/decl.c
&& !present_gnu_tree (gnat_entity)
&& In_Extended_Main_Code_Unit (gnat_entity))
{
-@@ -3391,7 +3394,7 @@
+@@ -847,46 +851,8 @@
+ && No (Renamed_Object (gnat_entity))
+ && No (Address_Clause (gnat_entity))))
+ && TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST)
+- {
+- unsigned int size_cap, align_cap;
++ align = promote_object_alignment (gnu_type, gnat_entity);
+
+- /* No point in promoting the alignment if this doesn't prevent
+- BLKmode access to the object, in particular block copy, as
+- this will for example disable the NRV optimization for it.
+- No point in jumping through all the hoops needed in order
+- to support BIGGEST_ALIGNMENT if we don't really have to.
+- So we cap to the smallest alignment that corresponds to
+- a known efficient memory access pattern of the target. */
+- if (Is_Atomic_Or_VFA (gnat_entity))
+- {
+- size_cap = UINT_MAX;
+- align_cap = BIGGEST_ALIGNMENT;
+- }
+- else
+- {
+- size_cap = MAX_FIXED_MODE_SIZE;
+- align_cap = get_mode_alignment (ptr_mode);
+- }
+-
+- if (!tree_fits_uhwi_p (TYPE_SIZE (gnu_type))
+- || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0)
+- align = 0;
+- else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0)
+- align = align_cap;
+- else
+- align = ceil_pow2 (tree_to_uhwi (TYPE_SIZE (gnu_type)));
+-
+- /* But make sure not to under-align the object. */
+- if (align <= TYPE_ALIGN (gnu_type))
+- align = 0;
+-
+- /* And honor the minimum valid atomic alignment, if any. */
+-#ifdef MINIMUM_ATOMIC_ALIGNMENT
+- else if (align < MINIMUM_ATOMIC_ALIGNMENT)
+- align = MINIMUM_ATOMIC_ALIGNMENT;
+-#endif
+- }
+-
+ /* If the object is set to have atomic components, find the component
+ type and validate it.
+
+@@ -1413,6 +1379,19 @@
+ gnu_size = NULL_TREE;
+ }
+
++ /* If this is an aggregate constant initialized to a constant, force it
++ to be statically allocated. This saves an initialization copy. */
++ if (!static_flag
++ && const_flag
++ && gnu_expr
++ && TREE_CONSTANT (gnu_expr)
++ && AGGREGATE_TYPE_P (gnu_type)
++ && tree_fits_uhwi_p (TYPE_SIZE_UNIT (gnu_type))
++ && !(TYPE_IS_PADDING_P (gnu_type)
++ && !tree_fits_uhwi_p (TYPE_SIZE_UNIT
++ (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
++ static_flag = true;
++
+ /* If this is an aliased object with an unconstrained array nominal
+ subtype, we make its type a thin reference, i.e. the reference
+ counterpart of a thin pointer, so it points to the array part.
+@@ -1463,18 +1442,6 @@
+ && No (Address_Clause (gnat_entity))))
+ gnu_ext_name = create_concat_name (gnat_entity, NULL);
+
+- /* If this is an aggregate constant initialized to a constant, force it
+- to be statically allocated. This saves an initialization copy. */
+- if (!static_flag
+- && const_flag
+- && gnu_expr && TREE_CONSTANT (gnu_expr)
+- && AGGREGATE_TYPE_P (gnu_type)
+- && tree_fits_uhwi_p (TYPE_SIZE_UNIT (gnu_type))
+- && !(TYPE_IS_PADDING_P (gnu_type)
+- && !tree_fits_uhwi_p (TYPE_SIZE_UNIT
+- (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
+- static_flag = true;
+-
+ /* Deal with a pragma Linker_Section on a constant or variable. */
+ if ((kind == E_Constant || kind == E_Variable)
+ && Present (Linker_Section_Pragma (gnat_entity)))
+@@ -3391,7 +3358,7 @@
{
gnu_decl = gnat_to_gnu_entity (Cloned_Subtype (gnat_entity),
NULL_TREE, false);
@@ -3590,11 +4890,143 @@ Index: gcc/ada/gcc-interface/decl.c
break;
}
+@@ -4505,18 +4472,6 @@
+ already defined so we cannot pass true for IN_PLACE here. */
+ process_attributes (&gnu_type, &attr_list, false, gnat_entity);
+
+- /* Tell the middle-end that objects of tagged types are guaranteed to
+- be properly aligned. This is necessary because conversions to the
+- class-wide type are translated into conversions to the root type,
+- which can be less aligned than some of its derived types. */
+- if (Is_Tagged_Type (gnat_entity)
+- || Is_Class_Wide_Equivalent_Type (gnat_entity))
+- TYPE_ALIGN_OK (gnu_type) = 1;
+-
+- /* Record whether the type is passed by reference. */
+- if (!VOID_TYPE_P (gnu_type) && Is_By_Reference_Type (gnat_entity))
+- TYPE_BY_REFERENCE_P (gnu_type) = 1;
+-
+ /* ??? Don't set the size for a String_Literal since it is either
+ confirming or we don't handle it properly (if the low bound is
+ non-constant). */
+@@ -4726,17 +4681,29 @@
+ /* If this is not an unconstrained array type, set some flags. */
+ if (TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE)
+ {
++ /* Tell the middle-end that objects of tagged types are guaranteed to
++ be properly aligned. This is necessary because conversions to the
++ class-wide type are translated into conversions to the root type,
++ which can be less aligned than some of its derived types. */
++ if (Is_Tagged_Type (gnat_entity)
++ || Is_Class_Wide_Equivalent_Type (gnat_entity))
++ TYPE_ALIGN_OK (gnu_type) = 1;
++
++ /* Record whether the type is passed by reference. */
++ if (Is_By_Reference_Type (gnat_entity) && !VOID_TYPE_P (gnu_type))
++ TYPE_BY_REFERENCE_P (gnu_type) = 1;
++
++ /* Record whether an alignment clause was specified. */
+ if (Present (Alignment_Clause (gnat_entity)))
+ TYPE_USER_ALIGN (gnu_type) = 1;
+
++ /* Record whether a pragma Universal_Aliasing was specified. */
+ if (Universal_Aliasing (gnat_entity) && !TYPE_IS_DUMMY_P (gnu_type))
+ TYPE_UNIVERSAL_ALIASING_P (gnu_type) = 1;
+
+ /* If it is passed by reference, force BLKmode to ensure that
+ objects of this type will always be put in memory. */
+- if (TYPE_MODE (gnu_type) != BLKmode
+- && AGGREGATE_TYPE_P (gnu_type)
+- && TYPE_BY_REFERENCE_P (gnu_type))
++ if (AGGREGATE_TYPE_P (gnu_type) && TYPE_BY_REFERENCE_P (gnu_type))
+ SET_TYPE_MODE (gnu_type, BLKmode);
+ }
+
+@@ -7114,7 +7081,15 @@
+ }
+
+ if (Is_Atomic_Or_VFA (gnat_field))
+- check_ok_for_atomic_type (gnu_field_type, gnat_field, false);
++ {
++ const unsigned int align
++ = promote_object_alignment (gnu_field_type, gnat_field);
++ if (align > 0)
++ gnu_field_type
++ = maybe_pad_type (gnu_field_type, NULL_TREE, align, gnat_field,
++ false, false, definition, true);
++ check_ok_for_atomic_type (gnu_field_type, gnat_field, false);
++ }
+
+ if (Present (Component_Clause (gnat_field)))
+ {
+@@ -8788,6 +8763,53 @@
+ return align;
+ }
+
++/* Promote the alignment of GNU_TYPE corresponding to GNAT_ENTITY. Return
++ a positive value on success or zero on failure. */
++
++static unsigned int
++promote_object_alignment (tree gnu_type, Entity_Id gnat_entity)
++{
++ unsigned int align, size_cap, align_cap;
++
++ /* No point in promoting the alignment if this doesn't prevent BLKmode access
++ to the object, in particular block copy, as this will for example disable
++ the NRV optimization for it. No point in jumping through all the hoops
++ needed in order to support BIGGEST_ALIGNMENT if we don't really have to.
++ So we cap to the smallest alignment that corresponds to a known efficient
++ memory access pattern, except for Atomic and Volatile_Full_Access. */
++ if (Is_Atomic_Or_VFA (gnat_entity))
++ {
++ size_cap = UINT_MAX;
++ align_cap = BIGGEST_ALIGNMENT;
++ }
++ else
++ {
++ size_cap = MAX_FIXED_MODE_SIZE;
++ align_cap = get_mode_alignment (ptr_mode);
++ }
++
++ /* Do the promotion within the above limits. */
++ if (!tree_fits_uhwi_p (TYPE_SIZE (gnu_type))
++ || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0)
++ align = 0;
++ else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0)
++ align = align_cap;
++ else
++ align = ceil_pow2 (tree_to_uhwi (TYPE_SIZE (gnu_type)));
++
++ /* But make sure not to under-align the object. */
++ if (align <= TYPE_ALIGN (gnu_type))
++ align = 0;
++
++ /* And honor the minimum valid atomic alignment, if any. */
++#ifdef MINIMUM_ATOMIC_ALIGNMENT
++ else if (align < MINIMUM_ATOMIC_ALIGNMENT)
++ align = MINIMUM_ATOMIC_ALIGNMENT;
++#endif
++
++ return align;
++}
++
+ /* Verify that TYPE is something we can implement atomically. If not, issue
+ an error for GNAT_ENTITY. COMPONENT_P is true if we are being called to
+ process a component type. */
Index: gcc/ada/gcc-interface/trans.c
===================================================================
--- a/src/gcc/ada/gcc-interface/trans.c (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/ada/gcc-interface/trans.c (.../branches/gcc-7-branch)
-@@ -4326,11 +4326,11 @@
+@@ -4058,8 +4058,6 @@
+ case N_Identifier:
+ case N_Expanded_Name:
+ gnat_entity = Entity (gnat_node);
+- if (Ekind (gnat_entity) != E_Variable)
+- break;
+ return Is_Volatile_Full_Access (gnat_entity)
+ || Is_Volatile_Full_Access (Etype (gnat_entity));
+
+@@ -4326,11 +4324,11 @@
parameters.
2. There is no target and the call is made for neither an object nor a
@@ -3611,7 +5043,7 @@ Index: gcc/ada/gcc-interface/trans.c
3. There is a target and it is a slice or an array with fixed size,
and the return type has variable size, because the gimplifier
-@@ -4349,6 +4349,8 @@
+@@ -4349,6 +4347,8 @@
&& Nkind (Parent (gnat_node)) != N_Object_Declaration
&& Nkind (Parent (gnat_node)) != N_Object_Renaming_Declaration
&& Nkind (Parent (gnat_node)) != N_Simple_Return_Statement
@@ -3620,7 +5052,7 @@ Index: gcc/ada/gcc-interface/trans.c
&& AGGREGATE_TYPE_P (gnu_result_type)
&& !TYPE_IS_FAT_POINTER_P (gnu_result_type))
|| (gnu_target
-@@ -9702,7 +9704,14 @@
+@@ -9702,7 +9702,14 @@
gnat_component_type);
else
{
@@ -3636,6 +5068,38 @@ Index: gcc/ada/gcc-interface/trans.c
/* Before assigning the element to the array, make sure it is
in range. */
+Index: gcc/asan.c
+===================================================================
+--- a/src/gcc/asan.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/asan.c (.../branches/gcc-7-branch)
+@@ -2315,9 +2315,12 @@
+ /* DECL_NAME theoretically might be NULL. Bail out with 0 in this case. */
+ if (decl_name == NULL_TREE)
+ return build_int_cst (uptr, 0);
+- size_t len = strlen (IDENTIFIER_POINTER (decl_name)) + sizeof ("__odr_asan_");
++ const char *dname = IDENTIFIER_POINTER (decl_name);
++ if (HAS_DECL_ASSEMBLER_NAME_P (decl))
++ dname = targetm.strip_name_encoding (dname);
++ size_t len = strlen (dname) + sizeof ("__odr_asan_");
+ name = XALLOCAVEC (char, len);
+- snprintf (name, len, "__odr_asan_%s", IDENTIFIER_POINTER (decl_name));
++ snprintf (name, len, "__odr_asan_%s", dname);
+ #ifndef NO_DOT_IN_LABEL
+ name[sizeof ("__odr_asan") - 1] = '.';
+ #elif !defined(NO_DOLLAR_IN_LABEL)
+Index: gcc/lra-remat.c
+===================================================================
+--- a/src/gcc/lra-remat.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/lra-remat.c (.../branches/gcc-7-branch)
+@@ -684,7 +684,7 @@
+
+ if (regno2 >= FIRST_PSEUDO_REGISTER && reg_renumber[regno2] >= 0)
+ regno2 = reg_renumber[regno2];
+- if (regno >= FIRST_PSEUDO_REGISTER)
++ if (regno2 >= FIRST_PSEUDO_REGISTER)
+ nregs2 = 1;
+ else
+ nregs2 = hard_regno_nregs[regno2][reg->biggest_mode];
Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- a/src/gcc/gimple-ssa-strength-reduction.c (.../tags/gcc_7_2_0_release)
@@ -3885,7 +5349,31 @@ Index: gcc/gimple-ssa-strength-reduction.c
print_gimple_stmt (dump_file, new_stmt, 0, 0);
}
-@@ -3736,6 +3720,10 @@
+@@ -3217,6 +3201,23 @@
+ that block, the earliest one will be returned in WHERE. */
+ bb = nearest_common_dominator_for_cands (c, incr, &where);
+
++ /* If the NCD is not dominated by the block containing the
++ definition of the stride, we can't legally insert a
++ single initializer. Mark the increment as unprofitable
++ so we don't make any replacements. FIXME: Multiple
++ initializers could be placed with more analysis. */
++ gimple *stride_def = SSA_NAME_DEF_STMT (c->stride);
++ basic_block stride_bb = gimple_bb (stride_def);
++
++ if (stride_bb && !dominated_by_p (CDI_DOMINATORS, bb, stride_bb))
++ {
++ if (dump_file && (dump_flags & TDF_DETAILS))
++ fprintf (dump_file,
++ "Initializer #%d cannot be legally placed\n", i);
++ incr_vec[i].cost = COST_INFINITE;
++ continue;
++ }
++
+ /* If the nominal stride has a different type than the recorded
+ stride type, build a cast from the nominal stride to that type. */
+ if (!types_compatible_p (TREE_TYPE (c->stride), c->stride_type))
+@@ -3736,6 +3737,10 @@
free (incr_vec);
}
}
@@ -3995,6 +5483,61 @@ Index: gcc/fortran/trans-io.c
if (ts->type == BT_CLASS)
derived = ts->u.derived->components->ts.u.derived;
+Index: gcc/calls.c
+===================================================================
+--- a/src/gcc/calls.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/calls.c (.../branches/gcc-7-branch)
+@@ -1220,32 +1220,38 @@
+ else if (!strcasecmp (end, "KiB") || strcmp (end, "KB"))
+ unit = 1024;
+ else if (!strcmp (end, "MB"))
+- unit = 1000LU * 1000;
++ unit = HOST_WIDE_INT_UC (1000) * 1000;
+ else if (!strcasecmp (end, "MiB"))
+- unit = 1024LU * 1024;
++ unit = HOST_WIDE_INT_UC (1024) * 1024;
+ else if (!strcasecmp (end, "GB"))
+- unit = 1000LU * 1000 * 1000;
++ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000;
+ else if (!strcasecmp (end, "GiB"))
+- unit = 1024LU * 1024 * 1024;
++ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024;
+ else if (!strcasecmp (end, "TB"))
+- unit = 1000LU * 1000 * 1000 * 1000;
++ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000;
+ else if (!strcasecmp (end, "TiB"))
+- unit = 1024LU * 1024 * 1024 * 1024;
++ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024;
+ else if (!strcasecmp (end, "PB"))
+- unit = 1000LU * 1000 * 1000 * 1000 * 1000;
++ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000;
+ else if (!strcasecmp (end, "PiB"))
+- unit = 1024LU * 1024 * 1024 * 1024 * 1024;
++ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024;
+ else if (!strcasecmp (end, "EB"))
+- unit = 1000LU * 1000 * 1000 * 1000 * 1000 * 1000;
++ unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000
++ * 1000;
+ else if (!strcasecmp (end, "EiB"))
+- unit = 1024LU * 1024 * 1024 * 1024 * 1024 * 1024;
++ unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024
++ * 1024;
+ else
+ unit = 0;
+ }
+
+ if (unit)
+- alloc_object_size_limit
+- = build_int_cst (ssizetype, limit * unit);
++ {
++ wide_int w = wi::uhwi (limit, HOST_BITS_PER_WIDE_INT + 64);
++ w *= unit;
++ if (wi::ltu_p (w, alloc_object_size_limit))
++ alloc_object_size_limit = wide_int_to_tree (ssizetype, w);
++ }
+ }
+ }
+ }
Index: gcc/gimple-fold.c
===================================================================
--- a/src/gcc/gimple-fold.c (.../tags/gcc_7_2_0_release)
@@ -306133,6 +307676,30 @@ Index: gcc/po/zh_CN.po
#~ msgid "bad method signature"
#~ msgstr "错误的方法签名"
+Index: gcc/bb-reorder.c
+===================================================================
+--- a/src/gcc/bb-reorder.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/bb-reorder.c (.../branches/gcc-7-branch)
+@@ -2881,7 +2881,8 @@
+
+ crossing_edges = find_rarely_executed_basic_blocks_and_crossing_edges ();
+ if (!crossing_edges.exists ())
+- return 0;
++ /* Make sure to process deferred rescans and clear changeable df flags. */
++ return TODO_df_finish;
+
+ crtl->has_bb_partition = true;
+
+@@ -2947,7 +2948,8 @@
+ df_analyze ();
+ }
+
+- return 0;
++ /* Make sure to process deferred rescans and clear changeable df flags. */
++ return TODO_df_finish;
+ }
+
+ } // anon namespace
Index: gcc/config.gcc
===================================================================
--- a/src/gcc/config.gcc (.../tags/gcc_7_2_0_release)
@@ -306146,6 +307713,84 @@ Index: gcc/config.gcc
tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
;;
powerpc*-*-linux*)
+Index: gcc/tree-cfg.c
+===================================================================
+--- a/src/gcc/tree-cfg.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/tree-cfg.c (.../branches/gcc-7-branch)
+@@ -6667,7 +6667,15 @@
+ *tp = t = out->to;
+ }
+
+- DECL_CONTEXT (t) = p->to_context;
++ /* For FORCED_LABELs we can end up with references from other
++ functions if some SESE regions are outlined. It is UB to
++ jump in between them, but they could be used just for printing
++ addresses etc. In that case, DECL_CONTEXT on the label should
++ be the function containing the glabel stmt with that LABEL_DECL,
++ rather than whatever function a reference to the label was seen
++ last time. */
++ if (!FORCED_LABEL (t) && !DECL_NONLOCAL (t))
++ DECL_CONTEXT (t) = p->to_context;
+ }
+ else if (p->remap_decls_p)
+ {
+@@ -6785,6 +6793,21 @@
+ case GIMPLE_OMP_RETURN:
+ case GIMPLE_OMP_CONTINUE:
+ break;
++
++ case GIMPLE_LABEL:
++ {
++ /* For FORCED_LABEL, move_stmt_op doesn't adjust DECL_CONTEXT,
++ so that such labels can be referenced from other regions.
++ Make sure to update it when seeing a GIMPLE_LABEL though,
++ that is the owner of the label. */
++ walk_gimple_op (stmt, move_stmt_op, wi);
++ *handled_ops_p = true;
++ tree label = gimple_label_label (as_a <glabel *> (stmt));
++ if (FORCED_LABEL (label) || DECL_NONLOCAL (label))
++ DECL_CONTEXT (label) = p->to_context;
++ }
++ break;
++
+ default:
+ if (is_gimple_omp (stmt))
+ {
+Index: gcc/config/sparc/sparc.md
+===================================================================
+--- a/src/gcc/config/sparc/sparc.md (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/config/sparc/sparc.md (.../branches/gcc-7-branch)
+@@ -4518,7 +4518,14 @@
+ ;; The 32-bit multiply/divide instructions are deprecated on v9, but at
+ ;; least in UltraSPARC I, II and IIi it is a win tick-wise.
+
+-(define_insn "mulsi3"
++(define_expand "mulsi3"
++ [(set (match_operand:SI 0 "register_operand" "")
++ (mult:SI (match_operand:SI 1 "arith_operand" "")
++ (match_operand:SI 2 "arith_operand" "")))]
++ "TARGET_HARD_MUL || TARGET_ARCH64"
++ "")
++
++(define_insn "*mulsi3_sp32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (mult:SI (match_operand:SI 1 "arith_operand" "%r")
+ (match_operand:SI 2 "arith_operand" "rI")))]
+@@ -4526,6 +4533,14 @@
+ "smul\t%1, %2, %0"
+ [(set_attr "type" "imul")])
+
++(define_insn "*mulsi3_sp64"
++ [(set (match_operand:SI 0 "register_operand" "=r")
++ (mult:SI (match_operand:SI 1 "arith_operand" "%r")
++ (match_operand:SI 2 "arith_operand" "rI")))]
++ "TARGET_ARCH64"
++ "mulx\t%1, %2, %0"
++ [(set_attr "type" "imul")])
++
+ (define_expand "muldi3"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (mult:DI (match_operand:DI 1 "arith_operand" "")
Index: gcc/config/i386/i386.c
===================================================================
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_7_2_0_release)
@@ -306347,6 +307992,18 @@ Index: gcc/config/avr/avr.c
false },
{ "absdata", 0, 0, true, false, false, avr_handle_absdata_attribute,
false },
+Index: gcc/config/xtensa/xtensa.c
+===================================================================
+--- a/src/gcc/config/xtensa/xtensa.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/config/xtensa/xtensa.c (.../branches/gcc-7-branch)
+@@ -605,6 +605,7 @@
+ case HImode:
+ return xtensa_uimm8x2 (v);
+
++ case DImode:
+ case DFmode:
+ return (xtensa_uimm8x4 (v) && xtensa_uimm8x4 (v + 4));
+
Index: gcc/config/gnu-user.h
===================================================================
--- a/src/gcc/config/gnu-user.h (.../tags/gcc_7_2_0_release)
@@ -306545,7 +308202,29 @@ Index: gcc/config/rs6000/rs6000.c
===================================================================
--- a/src/gcc/config/rs6000/rs6000.c (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/config/rs6000/rs6000.c (.../branches/gcc-7-branch)
-@@ -39555,6 +39555,22 @@
+@@ -5766,8 +5766,20 @@
+ if (SCALAR_FLOAT_TYPE_P (elem_type)
+ && TYPE_PRECISION (elem_type) == 32)
+ return 5;
++ /* On POWER9, integer vector types are built up in GPRs and then
++ use a direct move (2 cycles). For POWER8 this is even worse,
++ as we need two direct moves and a merge, and the direct moves
++ are five cycles. */
++ else if (INTEGRAL_TYPE_P (elem_type))
++ {
++ if (TARGET_P9_VECTOR)
++ return TYPE_VECTOR_SUBPARTS (vectype) - 1 + 2;
++ else
++ return TYPE_VECTOR_SUBPARTS (vectype) - 1 + 5;
++ }
+ else
+- return max (2, TYPE_VECTOR_SUBPARTS (vectype) - 1);
++ /* V2DFmode doesn't need a direct move. */
++ return 2;
+
+ default:
+ gcc_unreachable ();
+@@ -39555,6 +39567,22 @@
/* Remember the last target of rs6000_set_current_function. */
static GTY(()) tree rs6000_previous_fndecl;
@@ -306568,7 +308247,7 @@ Index: gcc/config/rs6000/rs6000.c
/* Establish appropriate back-end context for processing the function
FNDECL. The argument might be NULL to indicate processing at top
level, outside of any function scope. */
-@@ -39561,17 +39577,8 @@
+@@ -39561,17 +39589,8 @@
static void
rs6000_set_current_function (tree fndecl)
{
@@ -306586,7 +308265,7 @@ Index: gcc/config/rs6000/rs6000.c
fprintf (stderr, "\n==================== rs6000_set_current_function");
if (fndecl)
-@@ -39584,11 +39591,43 @@
+@@ -39584,11 +39603,43 @@
fprintf (stderr, ", prev_fndecl (%p)", (void *)rs6000_previous_fndecl);
fprintf (stderr, "\n");
@@ -306631,7 +308310,7 @@ Index: gcc/config/rs6000/rs6000.c
}
if (old_tree)
-@@ -39595,47 +39634,17 @@
+@@ -39595,47 +39646,17 @@
{
fprintf (stderr, "\nold fndecl target specific options:\n");
debug_tree (old_tree);
@@ -306684,7 +308363,7 @@ Index: gcc/config/rs6000/rs6000.c
}
-@@ -42693,9 +42702,10 @@
+@@ -42693,9 +42714,10 @@
}
/* Given INSN that's a load or store based at BASE_REG, look for a
@@ -306697,7 +308376,7 @@ Index: gcc/config/rs6000/rs6000.c
{
df_ref base_use;
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
-@@ -42716,8 +42726,8 @@
+@@ -42716,8 +42738,8 @@
if (DF_REF_IS_ARTIFICIAL (base_def_link->ref))
break;
@@ -306708,7 +308387,7 @@ Index: gcc/config/rs6000/rs6000.c
if (and_operation != 0)
break;
}
-@@ -42739,7 +42749,8 @@
+@@ -42739,7 +42761,8 @@
rtx mem = XEXP (SET_SRC (body), 0);
rtx base_reg = XEXP (mem, 0);
@@ -306718,7 +308397,7 @@ Index: gcc/config/rs6000/rs6000.c
if (and_operation != 0)
{
-@@ -42763,7 +42774,21 @@
+@@ -42763,7 +42786,21 @@
to_delete[INSN_UID (swap_insn)].replace = true;
to_delete[INSN_UID (swap_insn)].replace_insn = swap_insn;
@@ -306741,7 +308420,7 @@ Index: gcc/config/rs6000/rs6000.c
SET_SRC (body) = mem;
INSN_CODE (insn) = -1; /* Force re-recognition. */
df_insn_rescan (insn);
-@@ -42786,7 +42811,8 @@
+@@ -42786,7 +42823,8 @@
rtx mem = SET_DEST (body);
rtx base_reg = XEXP (mem, 0);
@@ -306751,7 +308430,7 @@ Index: gcc/config/rs6000/rs6000.c
if (and_operation != 0)
{
-@@ -42814,7 +42840,21 @@
+@@ -42814,7 +42852,21 @@
to_delete[INSN_UID (swap_insn)].replace = true;
to_delete[INSN_UID (swap_insn)].replace_insn = swap_insn;
--
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