diff options
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/patches/svn-updates.diff | 2254 |
2 files changed, 2244 insertions, 11 deletions
diff --git a/debian/changelog b/debian/changelog index 797f9ac..5da50e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ gcc-5 (5.1.1-7) UNRELEASED; urgency=medium + * Update to SVN 20150522 (r223579, 5.1.1) from the gcc-5-branch. * Add description for the ada-gnattools-cross patch (YunQiang Su). * Provide a rtlibs stage to build a subset of target library packages. * Make symbols file symlinking for cross builds more robust. diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff index 1b581cc..4a3b03c 100644 --- a/debian/patches/svn-updates.diff +++ b/debian/patches/svn-updates.diff @@ -1,10 +1,10 @@ -# DP: updates from the 5 branch upto 20150519 (r223346). +# DP: updates from the 5 branch upto 20150522 (r223579). last_update() { cat > ${dir}LAST_UPDATED <EOF -Tue May 19 10:21:24 CEST 2015 -Tue May 19 08:21:24 UTC 2015 (revision 223346) +Fri May 22 18:22:54 CEST 2015 +Fri May 22 16:22:54 UTC 2015 (revision 223579) EOF } @@ -12,6 +12,329 @@ LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_5_1_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_5_1_0_release) ++++ b/src/libgomp/ChangeLog (.../branches/gcc-5-branch) +@@ -1,3 +1,21 @@ ++2015-05-22 Jakub Jelinek <jakub@redhat.com> ++ ++ Backported from mainline ++ 2015-05-19 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66199 ++ * testsuite/libgomp.c/pr66199-1.c: New test. ++ * testsuite/libgomp.c/pr66199-2.c: New test. ++ * testsuite/libgomp.c++/pr66199-1.C: New test. ++ * testsuite/libgomp.c++/pr66199-2.C: New test. ++ * testsuite/libgomp.fortran/pr66199-1.f90: New test. ++ * testsuite/libgomp.fortran/pr66199-2.f90: New test. ++ ++ 2015-05-13 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66133 ++ * testsuite/libgomp.c/pr66133.c: New test. ++ + 2015-04-22 Release Manager + + * GCC 5.1.0 released. +Index: libgomp/testsuite/libgomp.c++/pr66199-1.C +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c++/pr66199-1.C (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.c++/pr66199-1.C (.../branches/gcc-5-branch) +@@ -0,0 +1,5 @@ ++// PR middle-end/66199 ++// { dg-do run } ++// { dg-options "-O2 -fopenmp" } ++ ++#include "../libgomp.c/pr66199-1.c" +Index: libgomp/testsuite/libgomp.c++/pr66199-2.C +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c++/pr66199-2.C (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.c++/pr66199-2.C (.../branches/gcc-5-branch) +@@ -0,0 +1,5 @@ ++// PR middle-end/66199 ++// { dg-do run } ++// { dg-options "-O2 -fopenmp" } ++ ++#include "../libgomp.c/pr66199-2.c" +Index: libgomp/testsuite/libgomp.fortran/pr66199-1.f90 +=================================================================== +--- a/src/libgomp/testsuite/libgomp.fortran/pr66199-1.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.fortran/pr66199-1.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,49 @@ ++! PR middle-end/66199 ++! { dg-do run } ++! { dg-options "-O2 -fopenmp" } ++ ++ integer :: u(1024), v(1024), w(1024), a, b, c, d, e, a1, b1, a2, b2, d1, d2 ++ a = 1 ++ b = 1024 ++ d = 75 ++ !$omp parallel do simd default(none) firstprivate (a, b) shared(u, v, w) ++ do d = a, b ++ u(d) = v(d) + w(d) ++ end do ++ if (d .ne. 1025) call abort ++ c = 17 ++ d = 75 ++ !$omp parallel do simd default(none) firstprivate (a, b) shared(u, v, w) & ++ !$omp& linear(d) linear(c:5) lastprivate(e) ++ do d = a, b ++ u(d) = v(d) + w(d) ++ c = c + 5 ++ e = c ++ end do ++ if (d .ne. 1025 .or. c .ne. (17 + 5 * 1024)) call abort ++ if (e .ne. (17 + 5 * 1024)) call abort ++ a1 = 0 ++ a2 = 0 ++ b1 = 31 ++ b2 = 31 ++ d1 = 7 ++ d2 = 9 ++ !$omp parallel do simd default(none) firstprivate (a1, b1, a2, b2) & ++ !$omp& shared(u, v, w) lastprivate(d1, d2) collapse(2) ++ do d1 = a1, b1 ++ do d2 = a2, b2 ++ u(d1 * 32 + d2 + 1) = v(d1 * 32 + d2 + 1) + w(d1 * 32 + d2 + 1) ++ end do ++ end do ++ if (d1 .ne. 32 .or. d2 .ne. 32) call abort ++ d1 = 7 ++ d2 = 9 ++ !$omp parallel do simd default(none) firstprivate (a1, b1, a2, b2) & ++ !$omp& shared(u, v, w) collapse(2) ++ do d1 = a1, b1 ++ do d2 = a2, b2 ++ u(d1 * 32 + d2 + 1) = v(d1 * 32 + d2 + 1) + w(d1 * 32 + d2 + 1) ++ end do ++ end do ++ if (d1 .ne. 32 .or. d2 .ne. 32) call abort ++end +Index: libgomp/testsuite/libgomp.fortran/pr66199-2.f90 +=================================================================== +--- a/src/libgomp/testsuite/libgomp.fortran/pr66199-2.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.fortran/pr66199-2.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,47 @@ ++! PR middle-end/66199 ++! { dg-do run } ++! { dg-options "-O2 -fopenmp" } ++ ++ integer :: u(1024), v(1024), w(1024), a, b, c, d, e, a1, b1, a2, b2, d1, d2 ++ a = 1 ++ b = 1024 ++ d = 75 ++ !$omp target teams distribute parallel do simd default(none) & ++ !$omp& firstprivate (a, b) shared(u, v, w) ++ do d = a, b ++ u(d) = v(d) + w(d) ++ end do ++ c = 17 ++ d = 75 ++ !$omp target teams distribute parallel do simd default(none) & ++ !$omp& firstprivate (a, b) shared(u, v, w) & ++ !$omp& linear(d) linear(c:5) lastprivate(e) ++ do d = a, b ++ u(d) = v(d) + w(d) ++ c = c + 5 ++ e = c ++ end do ++ a1 = 0 ++ a2 = 0 ++ b1 = 31 ++ b2 = 31 ++ d1 = 7 ++ d2 = 9 ++ !$omp target teams distribute parallel do simd default(none) & ++ !$omp& firstprivate (a1, b1, a2, b2) & ++ !$omp& shared(u, v, w) lastprivate(d1, d2) collapse(2) ++ do d1 = a1, b1 ++ do d2 = a2, b2 ++ u(d1 * 32 + d2 + 1) = v(d1 * 32 + d2 + 1) + w(d1 * 32 + d2 + 1) ++ end do ++ end do ++ d1 = 7 ++ d2 = 9 ++ !$omp target teams distribute parallel do simd default(none) & ++ !$omp& firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2) ++ do d1 = a1, b1 ++ do d2 = a2, b2 ++ u(d1 * 32 + d2 + 1) = v(d1 * 32 + d2 + 1) + w(d1 * 32 + d2 + 1) ++ end do ++ end do ++end +Index: libgomp/testsuite/libgomp.c/pr66199-1.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/pr66199-1.c (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/pr66199-1.c (.../branches/gcc-5-branch) +@@ -0,0 +1,62 @@ ++/* PR middle-end/66199 */ ++/* { dg-do run } */ ++/* { dg-options "-O2 -fopenmp" } */ ++ ++int u[1024], v[1024], w[1024]; ++ ++__attribute__((noinline, noclone)) long ++f1 (long a, long b) ++{ ++ long d; ++ #pragma omp parallel for simd default(none) firstprivate (a, b) shared(u, v, w) ++ for (d = a; d < b; d++) ++ u[d] = v[d] + w[d]; ++ return d; ++} ++ ++__attribute__((noinline, noclone)) long ++f2 (long a, long b, long c) ++{ ++ long d, e; ++ #pragma omp parallel for simd default(none) firstprivate (a, b) shared(u, v, w) linear(d) linear(c:5) lastprivate(e) ++ for (d = a; d < b; d++) ++ { ++ u[d] = v[d] + w[d]; ++ c += 5; ++ e = c; ++ } ++ return d + c + e; ++} ++ ++__attribute__((noinline, noclone)) long ++f3 (long a1, long b1, long a2, long b2) ++{ ++ long d1, d2; ++ #pragma omp parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2) ++ for (d1 = a1; d1 < b1; d1++) ++ for (d2 = a2; d2 < b2; d2++) ++ u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2]; ++ return d1 + d2; ++} ++ ++__attribute__((noinline, noclone)) long ++f4 (long a1, long b1, long a2, long b2) ++{ ++ long d1, d2; ++ #pragma omp parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2) ++ for (d1 = a1; d1 < b1; d1++) ++ for (d2 = a2; d2 < b2; d2++) ++ u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2]; ++ return d1 + d2; ++} ++ ++int ++main () ++{ ++ if (f1 (0, 1024) != 1024 ++ || f2 (0, 1024, 17) != 1024 + 2 * (17 + 5 * 1024) ++ || f3 (0, 32, 0, 32) != 64 ++ || f4 (0, 32, 0, 32) != 64) ++ __builtin_abort (); ++ return 0; ++} +Index: libgomp/testsuite/libgomp.c/pr66199-2.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/pr66199-2.c (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/pr66199-2.c (.../branches/gcc-5-branch) +@@ -0,0 +1,59 @@ ++/* PR middle-end/66199 */ ++/* { dg-do run } */ ++/* { dg-options "-O2 -fopenmp" } */ ++ ++#pragma omp declare target ++int u[1024], v[1024], w[1024]; ++#pragma omp end declare target ++ ++__attribute__((noinline, noclone)) void ++f1 (long a, long b) ++{ ++ long d; ++ #pragma omp target teams distribute parallel for simd default(none) firstprivate (a, b) shared(u, v, w) ++ for (d = a; d < b; d++) ++ u[d] = v[d] + w[d]; ++} ++ ++__attribute__((noinline, noclone)) void ++f2 (long a, long b, long c) ++{ ++ long d, e; ++ #pragma omp target teams distribute parallel for simd default(none) firstprivate (a, b) shared(u, v, w) linear(d) linear(c:5) lastprivate(e) ++ for (d = a; d < b; d++) ++ { ++ u[d] = v[d] + w[d]; ++ c += 5; ++ e = c; ++ } ++} ++ ++__attribute__((noinline, noclone)) void ++f3 (long a1, long b1, long a2, long b2) ++{ ++ long d1, d2; ++ #pragma omp target teams distribute parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2) ++ for (d1 = a1; d1 < b1; d1++) ++ for (d2 = a2; d2 < b2; d2++) ++ u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2]; ++} ++ ++__attribute__((noinline, noclone)) void ++f4 (long a1, long b1, long a2, long b2) ++{ ++ long d1, d2; ++ #pragma omp target teams distribute parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2) ++ for (d1 = a1; d1 < b1; d1++) ++ for (d2 = a2; d2 < b2; d2++) ++ u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2]; ++} ++ ++int ++main () ++{ ++ f1 (0, 1024); ++ f2 (0, 1024, 17); ++ f3 (0, 32, 0, 32); ++ f4 (0, 32, 0, 32); ++ return 0; ++} +Index: libgomp/testsuite/libgomp.c/pr66133.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/pr66133.c (.../tags/gcc_5_1_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/pr66133.c (.../branches/gcc-5-branch) +@@ -0,0 +1,35 @@ ++/* PR middle-end/66133 */ ++/* { dg-do run } */ ++/* { dg-options "-O2 -fopenmp" } */ ++ ++#include <stdlib.h> ++#include <unistd.h> ++ ++volatile int x; ++ ++__attribute__((noinline)) void ++foo (void) ++{ ++ if (x == 0) ++ { ++ #pragma omp task ++ { ++ usleep (2000); ++ exit (0); ++ } ++ } ++ else ++ abort (); ++} ++ ++int ++main () ++{ ++ #pragma omp parallel num_threads (2) ++ { ++ #pragma omp barrier ++ #pragma omp single ++ foo (); ++ } ++ exit (0); ++} Index: libmpx/configure =================================================================== --- a/src/libmpx/configure (.../tags/gcc_5_1_0_release) @@ -4238,6 +4561,18 @@ Index: libsanitizer/ubsan/Makefile.in SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +Index: libstdc++-v3/configure.host +=================================================================== +--- a/src/libstdc++-v3/configure.host (.../tags/gcc_5_1_0_release) ++++ b/src/libstdc++-v3/configure.host (.../branches/gcc-5-branch) +@@ -216,7 +216,6 @@ + # Newer versions of AIX only support PowerPC architecture, so use + # atomic instructions directly. + os_include_dir="os/aix" +- atomic_word_dir="os/aix" + ;; + aix4.[3456789]*) + # We set os_include_dir to os/aix only on AIX 4.3 and newer, but Index: libstdc++-v3/include/debug/vector =================================================================== --- a/src/libstdc++-v3/include/debug/vector (.../tags/gcc_5_1_0_release) @@ -4293,7 +4628,18 @@ Index: libstdc++-v3/ChangeLog =================================================================== --- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_5_1_0_release) +++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-5-branch) -@@ -1,3 +1,37 @@ +@@ -1,3 +1,48 @@ ++2015-05-22 David Edelsohn <dje.gcc@gmail.com> ++ ++ Backported from mainline ++ 2015-05-21 David Edelsohn <dje.gcc@gmail.com> ++ ++ PR target/66224 ++ * config/cpu/powerpc/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER): ++ Don't use isync. Use lwsync if available. ++ * configure.host (atomic_word_dir) [aix[56789]*]: Delete to use ++ powerpc cpu definition. ++ +2015-05-07 Renlin Li <renlin.li@arm.com> + + Backported from mainline @@ -4542,6 +4888,23 @@ Index: libstdc++-v3/testsuite/libstdc++-xmethods/list.cc #include <list> int +Index: libstdc++-v3/config/cpu/powerpc/atomic_word.h +=================================================================== +--- a/src/libstdc++-v3/config/cpu/powerpc/atomic_word.h (.../tags/gcc_5_1_0_release) ++++ b/src/libstdc++-v3/config/cpu/powerpc/atomic_word.h (.../branches/gcc-5-branch) +@@ -27,10 +27,11 @@ + + typedef int _Atomic_word; + +-#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("isync":::"memory") + #ifdef __NO_LWSYNC__ ++#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("sync":::"memory") + #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory") + #else ++#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("lwsync":::"memory") + #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory") + #endif + Index: configure.ac =================================================================== --- a/src/configure.ac (.../tags/gcc_5_1_0_release) @@ -4619,6 +4982,19 @@ Index: gcc/tree-vrp.c return SSA_PROP_INTERESTING; } +Index: gcc/ipa-chkp.c +=================================================================== +--- a/src/gcc/ipa-chkp.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/ipa-chkp.c (.../branches/gcc-5-branch) +@@ -264,7 +264,7 @@ + if (!arg_type) + return orig_type; + +- type = copy_node (orig_type); ++ type = build_distinct_type_copy (orig_type); + TYPE_ARG_TYPES (type) = copy_list (TYPE_ARG_TYPES (type)); + + for (arg_type = TYPE_ARG_TYPES (type); Index: gcc/c-family/ChangeLog =================================================================== --- a/src/gcc/c-family/ChangeLog (.../tags/gcc_5_1_0_release) @@ -4842,13 +5218,85 @@ Index: gcc/c-family/c-ada-spec.c newline_and_indent (buffer, spc); pp_string (buffer, "end;"); newline_and_indent (buffer, spc); +Index: gcc/c/ChangeLog +=================================================================== +--- a/src/gcc/c/ChangeLog (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/c/ChangeLog (.../branches/gcc-5-branch) +@@ -1,3 +1,15 @@ ++2015-05-22 Jakub Jelinek <jakub@redhat.com> ++ ++ Backported from mainline ++ 2015-05-19 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66199 ++ * c-parser.c (c_parser_omp_for_loop): Don't add ++ OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving ++ OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES. ++ (c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined ++ constructs. ++ + 2015-04-22 Release Manager + + * GCC 5.1.0 released. +Index: gcc/c/c-parser.c +=================================================================== +--- a/src/gcc/c/c-parser.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/c/c-parser.c (.../branches/gcc-5-branch) +@@ -13069,12 +13069,9 @@ + } + else + { +- /* Copy lastprivate (decl) clause to OMP_FOR_CLAUSES, +- change it to shared (decl) in +- OMP_PARALLEL_CLAUSES. */ +- tree l = build_omp_clause (OMP_CLAUSE_LOCATION (*c), +- OMP_CLAUSE_LASTPRIVATE); +- OMP_CLAUSE_DECL (l) = OMP_CLAUSE_DECL (*c); ++ /* Move lastprivate (decl) clause to OMP_FOR_CLAUSES. */ ++ tree l = *c; ++ *c = OMP_CLAUSE_CHAIN (*c); + if (code == OMP_SIMD) + { + OMP_CLAUSE_CHAIN (l) +@@ -13086,7 +13083,6 @@ + OMP_CLAUSE_CHAIN (l) = clauses; + clauses = l; + } +- OMP_CLAUSE_SET_CODE (*c, OMP_CLAUSE_SHARED); + } + } + } +@@ -13771,6 +13767,7 @@ + TREE_TYPE (ret) = void_type_node; + OMP_TEAMS_CLAUSES (ret) = clauses; + OMP_TEAMS_BODY (ret) = block; ++ OMP_TEAMS_COMBINED (ret) = 1; + return add_stmt (ret); + } + } Index: gcc/DATESTAMP =================================================================== --- a/src/gcc/DATESTAMP (.../tags/gcc_5_1_0_release) +++ b/src/gcc/DATESTAMP (.../branches/gcc-5-branch) @@ -1 +1 @@ -20150422 -+20150519 ++20150522 +Index: gcc/tree.h +=================================================================== +--- a/src/gcc/tree.h (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/tree.h (.../branches/gcc-5-branch) +@@ -1320,6 +1320,11 @@ + #define OMP_PARALLEL_COMBINED(NODE) \ + (OMP_PARALLEL_CHECK (NODE)->base.private_flag) + ++/* True on an OMP_TEAMS statement if it represents an explicit ++ combined teams distribute constructs. */ ++#define OMP_TEAMS_COMBINED(NODE) \ ++ (OMP_TEAMS_CHECK (NODE)->base.private_flag) ++ + /* True if OMP_ATOMIC* is supposed to be sequentially consistent + as opposed to relaxed. */ + #define OMP_ATOMIC_SEQ_CST(NODE) \ Index: gcc/configure =================================================================== --- a/src/gcc/configure (.../tags/gcc_5_1_0_release) @@ -5064,11 +5512,212 @@ Index: gcc/lra-spills.c *loc = x != pseudo_slots[i].mem ? x : copy_rtx (x); } return; +Index: gcc/omp-low.c +=================================================================== +--- a/src/gcc/omp-low.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/omp-low.c (.../branches/gcc-5-branch) +@@ -5377,7 +5377,10 @@ + child_cfun = DECL_STRUCT_FUNCTION (child_fn); + + entry_bb = region->entry; +- exit_bb = region->exit; ++ if (gimple_code (entry_stmt) == GIMPLE_OMP_TASK) ++ exit_bb = region->cont; ++ else ++ exit_bb = region->exit; + + bool is_cilk_for + = (flag_cilkplus +@@ -5436,7 +5439,9 @@ + variable. In which case, we need to keep the assignment. */ + if (gimple_omp_taskreg_data_arg (entry_stmt)) + { +- basic_block entry_succ_bb = single_succ (entry_bb); ++ basic_block entry_succ_bb ++ = single_succ_p (entry_bb) ? single_succ (entry_bb) ++ : FALLTHRU_EDGE (entry_bb)->dest; + tree arg, narg; + gimple parcopy_stmt = NULL; + +@@ -5524,14 +5529,28 @@ + e = split_block (entry_bb, stmt); + gsi_remove (&gsi, true); + entry_bb = e->dest; +- single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU; ++ edge e2 = NULL; ++ if (gimple_code (entry_stmt) == GIMPLE_OMP_PARALLEL) ++ single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU; ++ else ++ { ++ e2 = make_edge (e->src, BRANCH_EDGE (entry_bb)->dest, EDGE_ABNORMAL); ++ gcc_assert (e2->dest == region->exit); ++ remove_edge (BRANCH_EDGE (entry_bb)); ++ set_immediate_dominator (CDI_DOMINATORS, e2->dest, e->src); ++ gsi = gsi_last_bb (region->exit); ++ gcc_assert (!gsi_end_p (gsi) ++ && gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_RETURN); ++ gsi_remove (&gsi, true); ++ } + +- /* Convert GIMPLE_OMP_RETURN into a RETURN_EXPR. */ ++ /* Convert GIMPLE_OMP_{RETURN,CONTINUE} into a RETURN_EXPR. */ + if (exit_bb) + { + gsi = gsi_last_bb (exit_bb); + gcc_assert (!gsi_end_p (gsi) +- && gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_RETURN); ++ && (gimple_code (gsi_stmt (gsi)) ++ == (e2 ? GIMPLE_OMP_CONTINUE : GIMPLE_OMP_RETURN))); + stmt = gimple_build_return (NULL); + gsi_insert_after (&gsi, stmt, GSI_SAME_STMT); + gsi_remove (&gsi, true); +@@ -5552,6 +5571,14 @@ + new_bb = move_sese_region_to_fn (child_cfun, entry_bb, exit_bb, block); + if (exit_bb) + single_succ_edge (new_bb)->flags = EDGE_FALLTHRU; ++ if (e2) ++ { ++ basic_block dest_bb = e2->dest; ++ if (!exit_bb) ++ make_edge (new_bb, dest_bb, EDGE_FALLTHRU); ++ remove_edge (e2); ++ set_immediate_dominator (CDI_DOMINATORS, dest_bb, new_bb); ++ } + /* When the OMP expansion process cannot guarantee an up-to-date + loop tree arrange for the child function to fixup loops. */ + if (loops_state_satisfies_p (LOOPS_NEED_FIXUP)) +@@ -10511,7 +10538,21 @@ + cond_code = EQ_EXPR; + } + +- cond = build2 (cond_code, boolean_type_node, fd->loop.v, fd->loop.n2); ++ tree n2 = fd->loop.n2; ++ if (fd->collapse > 1 ++ && TREE_CODE (n2) != INTEGER_CST ++ && gimple_omp_for_combined_into_p (fd->for_stmt) ++ && gimple_code (ctx->outer->stmt) == GIMPLE_OMP_FOR) ++ { ++ gomp_for *gfor = as_a <gomp_for *> (ctx->outer->stmt); ++ if (gimple_omp_for_kind (gfor) == GF_OMP_FOR_KIND_FOR) ++ { ++ struct omp_for_data outer_fd; ++ extract_omp_for_data (gfor, &outer_fd, NULL); ++ n2 = fold_convert (TREE_TYPE (n2), outer_fd.loop.n2); ++ } ++ } ++ cond = build2 (cond_code, boolean_type_node, fd->loop.v, n2); + + clauses = gimple_omp_for_clauses (fd->for_stmt); + stmts = NULL; +@@ -11158,6 +11199,10 @@ + gimple_seq_add_stmt (&new_body, gimple_build_label (ctx->cancel_label)); + gimple_seq_add_seq (&new_body, par_olist); + new_body = maybe_catch_exception (new_body); ++ if (gimple_code (stmt) == GIMPLE_OMP_TASK) ++ gimple_seq_add_stmt (&new_body, ++ gimple_build_omp_continue (integer_zero_node, ++ integer_zero_node)); + gimple_seq_add_stmt (&new_body, gimple_build_omp_return (false)); + gimple_omp_set_body (stmt, new_body); + +@@ -12272,6 +12317,10 @@ + somewhere other than the next block. This will be + created later. */ + cur_region->exit = bb; ++ if (cur_region->type == GIMPLE_OMP_TASK) ++ /* Add an edge corresponding to not scheduling the task ++ immediately. */ ++ make_edge (cur_region->entry, bb, EDGE_ABNORMAL); + fallthru = cur_region->type != GIMPLE_OMP_SECTION; + cur_region = cur_region->outer; + break; +@@ -12320,6 +12369,10 @@ + } + break; + ++ case GIMPLE_OMP_TASK: ++ fallthru = true; ++ break; ++ + default: + gcc_unreachable (); + } Index: gcc/ChangeLog =================================================================== --- a/src/gcc/ChangeLog (.../tags/gcc_5_1_0_release) +++ b/src/gcc/ChangeLog (.../branches/gcc-5-branch) -@@ -1,3 +1,368 @@ +@@ -1,3 +1,439 @@ ++2015-05-22 Jakub Jelinek <jakub@redhat.com> ++ ++ Backported from mainline ++ 2015-05-21 Jakub Jelinek <jakub@redhat.com> ++ ++ PR tree-optimization/66233 ++ * match.pd (ocvt (icvt@1 @0)): Don't handle vector types. ++ Simplify. ++ ++ 2015-05-19 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66199 ++ * tree.h (OMP_TEAMS_COMBINED): Define. ++ * gimplify.c (enum gimplify_omp_var_data): Add ++ GOVD_LINEAR_LASTPRIVATE_NO_OUTER. ++ (enum omp_region_type): Add ORT_COMBINED_TEAMS. ++ (omp_notice_variable): Accept both ORT_TEAMS ++ and ORT_COMBINED_TEAMS. Don't recurse if ++ GOVD_LINEAR_LASTPRIVATE_NO_OUTER is set and either ++ GOVD_LINEAR is set, or GOVD_LASTPRIVATE without ++ GOVD_FIRSTPRIVATE. ++ (omp_no_lastprivate): New function. ++ (gimplify_scan_omp_clauses): For OMP_CLAUSE_LASTPRIVATE ++ and OMP_CLAUSE_LINEAR, if omp_no_lastprivate, don't ++ notice_outer and set appropriate bits, otherwise make ++ sure default(none) combined constructs won't complain. ++ (gimplify_adjust_omp_clauses): Remove OMP_CLAUSE_LINEAR ++ outer special casing, for OMP_CLAUSE_LASTPRIVATE if ++ omp_no_lastprivate either remove the clause or turn it ++ into OMP_CLAUSE_PRIVATE. ++ (gimplify_omp_for): Fix up handling of implicit ++ lastprivate or linear iterators. ++ (gimplify_omp_workshare): For OMP_TEAMS_COMBINED use ++ ORT_COMBINED_TEAMS. ++ * omp-low.c (lower_omp_for_lastprivate): For combined ++ for simd use fd.loop.n2 from the for rather than simd. ++ ++ 2015-05-13 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66133 ++ * omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion, ++ make sure it is never noreturn, even when the task body does not ++ return. ++ (lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE ++ right before GIMPLE_OMP_RETURN. ++ (make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont ++ for GIMPLE_OMP_TASK. For GIMPLE_OMP_RETURN corresponding to ++ GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit. ++ ++2015-05-21 Sandra Loosemore <sandra@codesourcery.com> ++ ++ Backport from mainline r223418: ++ * config.gcc [powerpc*-*-linux*]: Allow --enable-targets=all ++ to build a biarch toolchain again. ++ ++2015-05-21 Ilya Enkovich <enkovich.gnu@gmail.com> ++ ++ Backport from mainline r223471 ++ 2015-05-21 Ilya Enkovich <enkovich.gnu@gmail.com> ++ ++ PR middle-end/66221 ++ * ipa-chkp.c (chkp_copy_function_type_adding_bounds): Use ++ build_distinct_type_copy to copy bounds. ++ ++2015-05-19 Uros Bizjak <ubizjak@gmail.com> ++ ++ PR target/66174 ++ * config/i386/i386.c (expand_vec_perm_blend): Enable HImode and ++ QImode inner modes for TARGET_AVX512BW. Force mask operand ++ to a register for AVX512F modes. ++ +2015-04-16 Jan Hubicka <hubicka@ucw.cz> + + PR target/66047 @@ -5437,7 +6086,7 @@ Index: gcc/ChangeLog 2015-04-22 Release Manager * GCC 5.1.0 released. -@@ -5384,6 +5749,7 @@ +@@ -5384,6 +5820,7 @@ 2015-01-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Jakub Jelinek <jakub@redhat.com> @@ -7422,6 +8071,41 @@ Index: gcc/testsuite/gcc.target/i386/avx512vbmi-vpermi2b-2.c #include "avx512f-mask-type.h" #define NUM 32 +Index: gcc/testsuite/gcc.target/i386/pr66174.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr66174.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr66174.c (.../branches/gcc-5-branch) +@@ -0,0 +1,30 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O -ftree-vectorize -mavx512f" } */ ++ ++extern void abort (void); ++ ++typedef struct { ++ unsigned int a; ++ unsigned int b; ++} ii; ++ ++void foo (unsigned short *arr, ii *iarr) ++{ ++ ii *iptr = iarr; ++ unsigned short res[128]; ++ ii ires[128]; ++ int i; ++ for (i = 0; i < 128; i++) ++ { ++ ires[i].a = iptr->b - iptr->a; ++ ires[i].b = iptr->b + iptr->a; ++ iptr++; ++ } ++ for (i = 0; i < 128; i++) ++ { ++ if (res[i] != arr[i] ++ || ires[i].a != iarr[i].b - iarr[i].a ++ || ires[i].b != iarr[i].b + iarr[i].a) ++ abort (); ++ } ++} Index: gcc/testsuite/gcc.target/i386/avx512bw-vpermt2w-2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/avx512bw-vpermt2w-2.c (.../tags/gcc_5_1_0_release) @@ -7543,6 +8227,36 @@ Index: gcc/testsuite/lib/target-supports.exp } elseif [check_vsx_hw_available] { lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign" } +Index: gcc/testsuite/gfortran.dg/generic_29.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/generic_29.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/generic_29.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,11 @@ ++! { dg-do compile} ++! PR fortran/66057 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++program p ++ type t ++ contains ++ generic :: ! { dg-error "Malformed GENERIC" } ++ end type ++end +Index: gcc/testsuite/gfortran.dg/null1.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/null1.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/null1.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,9 @@ ++! { dg-do compile } ++! PR fortran/66045 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++program p ++ contains ++ integer :: null=null() ! { dg-error "NULL appears on right-hand side" } ++end Index: gcc/testsuite/gfortran.dg/pr65429.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/pr65429.f90 (.../tags/gcc_5_1_0_release) @@ -7567,6 +8281,180 @@ Index: gcc/testsuite/gfortran.dg/pr65429.f90 + if ((u(1)/='qwerty').or.(u(2)/='asdfgh').or.(u(3)/='zxcvbn')) call abort + +end program foo +Index: gcc/testsuite/gfortran.dg/storage_size_6.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/storage_size_6.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/storage_size_6.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,8 @@ ++! { dg-do compile } ++! PR fortran/66043 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++program p ++ print *, storage_size(null()) ! { dg-error "cannot be an actual" } ++end +Index: gcc/testsuite/gfortran.dg/continuation_13.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/continuation_13.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/continuation_13.f90 (.../branches/gcc-5-branch) +@@ -19,6 +19,8 @@ + ) + 800 format('This is actually ok.'& !comment + ' end' ) ++900 format('This is actually ok.' & !comment ++ ' end' ) + write(astring,100) + if (astring.ne."This format is OK.") call abort + write(astring,200) +@@ -34,6 +36,8 @@ + write(astring,700) + if (astring.ne."This format now works.'") call abort + write(astring,800) ++if (astring.ne."This is actually ok.' end") call abort ++write(astring,900) + if (astring.ne."This is actually ok. end") call abort + + end +Index: gcc/testsuite/gfortran.dg/protected_9.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/protected_9.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/protected_9.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,15 @@ ++! { dg-do compile } ++! PR fortran/66052 ++! ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++module a ++ contains ++ protected x ! { dg-error "only allowed in specification part" } ++end module a ++ ++program p ++ contains ++ protected x ! { dg-error "only allowed in specification part" } ++end +Index: gcc/testsuite/gfortran.dg/filepos1.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/filepos1.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/filepos1.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,25 @@ ++! { dg-do compile } ++! PR fortran/66039 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++subroutine p1 ++ rewind (( ! { dg-error "Syntax error in REWIND" } ++ rewind (- ! { dg-error "Syntax error in REWIND" } ++end subroutine p1 ++ ++subroutine p2 ++ flush (( ! { dg-error "Syntax error in FLUSH" } ++ flush (- ! { dg-error "Syntax error in FLUSH" } ++end subroutine p2 ++ ++subroutine p4 ++ backspace (( ! { dg-error "Syntax error in BACKSPACE" } ++ backspace (- ! { dg-error "Syntax error in BACKSPACE" } ++end subroutine p4 ++ ++subroutine p3 ++ endfile (( ! { dg-error "Expecting END SUBROUTINE" } ++ endfile (- ! { dg-error "Expecting END SUBROUTINE" } ++end subroutine p3 ++ +Index: gcc/testsuite/gfortran.dg/entry_21.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/entry_21.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/entry_21.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,17 @@ ++! { dg-do compile } ++! PR fortran/66044 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++subroutine p ++end subroutine p ++ ++entry e ! { dg-error "Unexpected ENTRY statement" } ++end ++ ++module m ++ type t ++ contains ++ entry e ! { dg-error "Unexpected ENTRY statement" } ++ end type ++end module m +Index: gcc/testsuite/gfortran.dg/misplaced_statement.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/misplaced_statement.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/misplaced_statement.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,20 @@ ++!{ dg-do compile } ++! PR fortran/66040 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++real function f1(x) ++ sequence ! { dg-error "Unexpected SEQUENCE statement" } ++end function f1 ++ ++real function f2() ++ else ! { dg-error "Unexpected ELSE statement" } ++end function f2 ++ ++real function f3() ++ block data ! { dg-error "Unexpected BLOCK DATA statement" } ++end function f3 ++ ++real function f4() ++ program p ! { dg-error "Unexpected PROGRAM statement" } ++end function f4 +Index: gcc/testsuite/gfortran.dg/pr64925.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/pr64925.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/pr64925.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,22 @@ ++! { dg-do compile } ++! PR fortran/64925 ++! Original test case provided by Bill Long <longb at cray dot com> ++! ++subroutine foo(nnn, aaa, bbb, ccc, ddd) ++ implicit none ++ integer :: nnn, aaa, bbb(nnn) ++ integer :: i ++ do i=1,nnn ++ aaa = aaa + bbb(ccc(i)) ++ end do ++ call ddd(aaa) ++contains ++ integer function ccc(i) ! { dg-error "conflicts with DUMMY" } ++ integer :: i ++ ccc = i ++ end function ccc ++ subroutine ddd(j) ! { dg-error "conflicts with DUMMY" } ++ integer j ++ j = j + 1 ++ end subroutine ddd ++end subroutine foo +Index: gcc/testsuite/gfortran.dg/interface_operator_1.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/interface_operator_1.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/interface_operator_1.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,10 @@ ++! { dg-do compile } ++! PR fortran/66106 ++! ++! Original code from Gerhard Steinmetz ++! <gerhard dot steinmetz dot fortran at t-online dot de> ++program p ++ interface operator ( .gt. ) ++ end interface operator ! { dg-error "END INTERFACE OPERATOR" } ++end program p ! { dg-error "END INTERFACE" } ++! { dg-excess-errors "Unexpected end of file" } Index: gcc/testsuite/gfortran.dg/vect/vect-2.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/vect/vect-2.f90 (.../tags/gcc_5_1_0_release) @@ -7633,6 +8521,58 @@ Index: gcc/testsuite/gfortran.dg/vect/vect-5.f90 +! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } ! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } ! { dg-final { cleanup-tree-dump "vect" } } +Index: gcc/testsuite/gfortran.dg/pr65903.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/pr65903.f90 (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/pr65903.f90 (.../branches/gcc-5-branch) +@@ -0,0 +1,20 @@ ++! { dg-do run } ++! { dg-options "-std=gnu" } ++! ++character(20) :: astring ++ ++100 format ("& notblank !") ++200 format ("& !") ++300 format ("&!") ++ ++write(astring,100) ++if (astring.ne."& notblank !") call abort ++!print *, astring ++write(astring,200) ++if (astring.ne."& !") call abort ++!print *, astring ++write(astring,300) ++if (astring.ne."&!") call abort ++!print *, astring ++ ++end +Index: gcc/testsuite/gcc.c-torture/execute/pr66233.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/pr66233.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/pr66233.c (.../branches/gcc-5-branch) +@@ -0,0 +1,22 @@ ++/* PR tree-optimization/66233 */ ++ ++unsigned int v[8]; ++ ++__attribute__((noinline, noclone)) void ++foo (void) ++{ ++ int i; ++ for (i = 0; i < 8; i++) ++ v[i] = (float) i; ++} ++ ++int ++main () ++{ ++ unsigned int i; ++ foo (); ++ for (i = 0; i < 8; i++) ++ if (v[i] != i) ++ __builtin_abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.c-torture/compile/pr65875.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/compile/pr65875.c (.../tags/gcc_5_1_0_release) @@ -7779,6 +8719,30 @@ Index: gcc/testsuite/gcc.dg/pr65408.c + + return 0; +} +Index: gcc/testsuite/gcc.dg/lto/pr66221_0.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/lto/pr66221_0.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gcc.dg/lto/pr66221_0.c (.../branches/gcc-5-branch) +@@ -0,0 +1,10 @@ ++/* { dg-lto-do link } */ ++/* { dg-require-effective-target mpx } */ ++/* { dg-lto-options { { -O2 -flto -fcheck-pointer-bounds -mmpx } } } */ ++ ++int test1 (const char *); ++ ++int main (int argc, const char **argv) ++{ ++ return test1 (argv[0]); ++} +Index: gcc/testsuite/gcc.dg/lto/pr66221_1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/lto/pr66221_1.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/testsuite/gcc.dg/lto/pr66221_1.c (.../branches/gcc-5-branch) +@@ -0,0 +1,4 @@ ++int test1 (const char *p) ++{ ++ return (int)(*p); ++} Index: gcc/testsuite/gcc.dg/vect/vect-105.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/vect/vect-105.c (.../tags/gcc_5_1_0_release) @@ -8658,7 +9622,80 @@ Index: gcc/testsuite/ChangeLog =================================================================== --- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_5_1_0_release) +++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-5-branch) -@@ -1,3 +1,257 @@ +@@ -1,3 +1,330 @@ ++2015-05-22 Jakub Jelinek <jakub@redhat.com> ++ ++ Backported from mainline ++ 2015-05-21 Jakub Jelinek <jakub@redhat.com> ++ ++ PR tree-optimization/66233 ++ * gcc.c-torture/execute/pr66233.c: New test. ++ ++2015-05-21 Ilya Enkovich <enkovich.gnu@gmail.com> ++ ++ Backport from mainline r223471 ++ 2015-05-21 Ilya Enkovich <enkovich.gnu@gmail.com> ++ ++ PR middle-end/66221 ++ * gcc.dg/lto/pr66221_0.c: New test. ++ * gcc.dg/lto/pr66221_1.c: New test. ++ ++2015-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> ++ ++ PR fortran/65903 ++ * gfortran.dg/continuation_13.f90: Update test. ++ * gfortran.dg/pr65903.f90: New test. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66106 ++ * gfortran.dg/interface_operator_1.f90: New tests. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66057 ++ * gfortran.dg/generic_29.f90: New tests. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66052 ++ * gfortran.dg/protected_9.f90: New test. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66045 ++ * gfortran.dg/null1.f90: New test. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66044 ++ * gfortran.dg/entry_21.f90: New test. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66043 ++ * gfortran.dg/storage_size_6.f90: New tests. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66040 ++ * gfortran.dg/misplaced_statement.f90: New test. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66039 ++ * gfortran.dg/filepos1.f90: New test ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/64925 ++ * gfortran.dg/pr64925.f90: New test. ++ ++2015-05-19 Uros Bizjak <ubizjak@gmail.com> ++ ++ PR target/66174 ++ * gcc.target/i386/pr66174.c: New test. ++ +2015-04-16 Jan Hubicka <hubicka@ucw.cz> + + PR target/66047 @@ -9485,7 +10522,19 @@ Index: gcc/cp/ChangeLog =================================================================== --- a/src/gcc/cp/ChangeLog (.../tags/gcc_5_1_0_release) +++ b/src/gcc/cp/ChangeLog (.../branches/gcc-5-branch) -@@ -1,3 +1,90 @@ +@@ -1,3 +1,102 @@ ++2015-05-22 Jakub Jelinek <jakub@redhat.com> ++ ++ Backported from mainline ++ 2015-05-19 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66199 ++ * parser.c (cp_parser_omp_for_loop): Don't add ++ OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving ++ OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES. ++ (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined ++ constructs. ++ +2015-05-18 Jason Merrill <jason@redhat.com> + + * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms. @@ -9759,6 +10808,38 @@ Index: gcc/cp/parser.c } return attributes; +@@ -30466,11 +30480,9 @@ + else if (OMP_CLAUSE_CODE (*c) == OMP_CLAUSE_LASTPRIVATE + && OMP_CLAUSE_DECL (*c) == real_decl) + { +- /* Add lastprivate (decl) clause to OMP_FOR_CLAUSES, +- change it to shared (decl) in OMP_PARALLEL_CLAUSES. */ +- tree l = build_omp_clause (loc, OMP_CLAUSE_LASTPRIVATE); +- OMP_CLAUSE_DECL (l) = real_decl; +- CP_OMP_CLAUSE_INFO (l) = CP_OMP_CLAUSE_INFO (*c); ++ /* Move lastprivate (decl) clause to OMP_FOR_CLAUSES. */ ++ tree l = *c; ++ *c = OMP_CLAUSE_CHAIN (*c); + if (code == OMP_SIMD) + { + OMP_CLAUSE_CHAIN (l) = cclauses[C_OMP_CLAUSE_SPLIT_FOR]; +@@ -30481,8 +30493,6 @@ + OMP_CLAUSE_CHAIN (l) = clauses; + clauses = l; + } +- OMP_CLAUSE_SET_CODE (*c, OMP_CLAUSE_SHARED); +- CP_OMP_CLAUSE_INFO (*c) = NULL; + add_private_clause = false; + } + else +@@ -31316,6 +31326,7 @@ + TREE_TYPE (ret) = void_type_node; + OMP_TEAMS_CLAUSES (ret) = clauses; + OMP_TEAMS_BODY (ret) = body; ++ OMP_TEAMS_COMBINED (ret) = 1; + return add_stmt (ret); + } + } Index: gcc/cp/lambda.c =================================================================== --- a/src/gcc/cp/lambda.c (.../tags/gcc_5_1_0_release) @@ -9950,6 +11031,32 @@ Index: gcc/ipa-inline.c { if (estimate_edge_time (e) >= 20 + inline_edge_summary (e)->call_stmt_time) +Index: gcc/match.pd +=================================================================== +--- a/src/gcc/match.pd (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/match.pd (.../branches/gcc-5-branch) +@@ -702,16 +702,12 @@ + (for integers). Avoid this if the final type is a pointer since + then we sometimes need the middle conversion. Likewise if the + final type has a precision not equal to the size of its mode. */ +- (if (((inter_int && inside_int) +- || (inter_float && inside_float) +- || (inter_vec && inside_vec)) ++ (if (((inter_int && inside_int) || (inter_float && inside_float)) ++ && (final_int || final_float) + && inter_prec >= inside_prec +- && (inter_float || inter_vec +- || inter_unsignedp == inside_unsignedp) +- && ! (final_prec != GET_MODE_PRECISION (element_mode (type)) +- && element_mode (type) == element_mode (inter_type)) +- && ! final_ptr +- && (! final_vec || inter_prec == inside_prec)) ++ && (inter_float || inter_unsignedp == inside_unsignedp) ++ && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type)) ++ && TYPE_MODE (type) == TYPE_MODE (inter_type))) + (ocvt @0)) + + /* If we have a sign-extension of a zero-extended value, we can Index: gcc/go/gofrontend/expressions.cc =================================================================== --- a/src/gcc/go/gofrontend/expressions.cc (.../tags/gcc_5_1_0_release) @@ -10029,6 +11136,41 @@ Index: gcc/common/config/aarch64/aarch64-common.c return output_buf; } +Index: gcc/fortran/interface.c +=================================================================== +--- a/src/gcc/fortran/interface.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/interface.c (.../branches/gcc-5-branch) +@@ -346,8 +346,12 @@ + break; + + m = MATCH_ERROR; +- gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> at %C, " +- "but got %s", s1, s2); ++ if (strcmp(s2, "none") == 0) ++ gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> " ++ "at %C, ", s1); ++ else ++ gfc_error ("Expecting %<END INTERFACE OPERATOR (%s)%> at %C, " ++ "but got %s", s1, s2); + } + + } +Index: gcc/fortran/symbol.c +=================================================================== +--- a/src/gcc/fortran/symbol.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/symbol.c (.../branches/gcc-5-branch) +@@ -458,6 +458,11 @@ + } + } + ++ if (attr->dummy && ((attr->function || attr->subroutine) && ++ gfc_current_state () == COMP_CONTAINS)) ++ gfc_error_now ("internal procedure '%s' at %L conflicts with " ++ "DUMMY argument", name, where); ++ + conf (dummy, entry); + conf (dummy, intrinsic); + conf (dummy, threadprivate); Index: gcc/fortran/decl.c =================================================================== --- a/src/gcc/fortran/decl.c (.../tags/gcc_5_1_0_release) @@ -10044,11 +11186,160 @@ Index: gcc/fortran/decl.c sym->ts.u.cl->length = gfc_get_int_expr (gfc_default_integer_kind, NULL, clen); +@@ -5594,7 +5592,7 @@ + "a contained subprogram"); + break; + default: +- gfc_internal_error ("gfc_match_entry(): Bad state"); ++ gfc_error ("Unexpected ENTRY statement at %C"); + } + return MATCH_ERROR; + } +@@ -6970,7 +6968,8 @@ + gfc_symbol *sym; + match m; + +- if (gfc_current_ns->proc_name->attr.flavor != FL_MODULE) ++ if (!gfc_current_ns->proc_name ++ || gfc_current_ns->proc_name->attr.flavor != FL_MODULE) + { + gfc_error ("PROTECTED at %C only allowed in specification " + "part of a module"); +@@ -8512,6 +8511,11 @@ + gfc_op2string (op)); + break; + ++ case INTERFACE_NAMELESS: ++ gfc_error ("Malformed GENERIC statement at %C"); ++ goto error; ++ break; ++ + default: + gcc_unreachable (); + } +Index: gcc/fortran/trans-openmp.c +=================================================================== +--- a/src/gcc/fortran/trans-openmp.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/trans-openmp.c (.../branches/gcc-5-branch) +@@ -4114,6 +4114,7 @@ + stmtblock_t block; + gfc_omp_clauses clausesa_buf[GFC_OMP_SPLIT_NUM]; + tree stmt, omp_clauses = NULL_TREE; ++ bool combined = true; + + gfc_start_block (&block); + if (clausesa == NULL) +@@ -4130,6 +4131,7 @@ + case EXEC_OMP_TARGET_TEAMS: + case EXEC_OMP_TEAMS: + stmt = gfc_trans_omp_code (code->block->next, true); ++ combined = false; + break; + case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE: + case EXEC_OMP_TEAMS_DISTRIBUTE: +@@ -4143,6 +4145,8 @@ + } + stmt = build2_loc (input_location, OMP_TEAMS, void_type_node, stmt, + omp_clauses); ++ if (combined) ++ OMP_TEAMS_COMBINED (stmt) = 1; + gfc_add_expr_to_block (&block, stmt); + return gfc_finish_block (&block); + } +@@ -4163,9 +4167,14 @@ + if (code->op == EXEC_OMP_TARGET) + stmt = gfc_trans_omp_code (code->block->next, true); + else +- stmt = gfc_trans_omp_teams (code, clausesa); +- if (TREE_CODE (stmt) != BIND_EXPR) +- stmt = build3_v (BIND_EXPR, NULL, stmt, NULL_TREE); ++ { ++ pushlevel (); ++ stmt = gfc_trans_omp_teams (code, clausesa); ++ if (TREE_CODE (stmt) != BIND_EXPR) ++ stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0)); ++ else ++ poplevel (0, 0); ++ } + if (flag_openmp) + stmt = build2_loc (input_location, OMP_TARGET, void_type_node, stmt, + omp_clauses); Index: gcc/fortran/ChangeLog =================================================================== --- a/src/gcc/fortran/ChangeLog (.../tags/gcc_5_1_0_release) +++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-5-branch) -@@ -1,7 +1,17 @@ +@@ -1,7 +1,88 @@ ++2015-05-22 Jakub Jelinek <jakub@redhat.com> ++ ++ Backported from mainline ++ 2015-05-19 Jakub Jelinek <jakub@redhat.com> ++ ++ PR middle-end/66199 ++ * trans-openmp.c (gfc_trans_omp_teams): Set OMP_TEAMS_COMBINED for ++ combined constructs. ++ (gfc_trans_omp_target): Make sure BIND_EXPR has non-NULL ++ BIND_EXPR_BLOCK. ++ ++2015-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> ++ ++ PR fortran/65903 ++ * io.c (format_lex): Change to NONSTRING when checking for ++ possible doubled quote. ++ * scanner.c (gfc_next_char_literal): Revert change from 64506 ++ and add a check for quotes and return. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66106 ++ * interface.c(gfc_match_end_interface): Enforce F2008 C1202 (R1201). ++ * match.c(gfc_op2string): Return 'none' for INTRINSIC_NONE. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66057 ++ * decl.c(gfc_match_generic): Detected a malformed GENERIC statement. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66052 ++ * decl.c(gfc_match_protected): Prevent dereference of NULL pointer. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66045 ++ * expr.c (gfc_check_assign): Check for assignment of NULL() instead ++ of the (intended) pointer assignment. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66044 ++ * decl.c(gfc_match_entry): Change a gfc_internal_error() into ++ a gfc_error() ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66043 ++ * check.c (gfc_check_storage_size): Prevent the direct use of NULL() ++ in STORAGE_SIZE() reference. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66040 ++ * parse.c(verify_st_order): Replace a gfc_internal_error with your ++ generic gfc_error. ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/66039 ++ * io.c (match_filepos): Check for incomplete/mangled REWIND, FLUSH, ++ BACKSPACE, and ENDFILE statements ++ ++2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org> ++ ++ PR fortran/64925 ++ * symbol.c(check_conflict): Check for a conflict between a dummy ++ argument and an internal procedure name. ++ +2015-05-02 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/65976 @@ -10066,6 +11357,148 @@ Index: gcc/fortran/ChangeLog 2015-04-10 Tobias Burnus <burnus@net-b.de> * trans-stmt.c (gfc_trans_lock_unlock): Implement -fcoarray=lib +Index: gcc/fortran/expr.c +=================================================================== +--- a/src/gcc/fortran/expr.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/expr.c (.../branches/gcc-5-branch) +@@ -3118,12 +3118,14 @@ + bad_proc = true; + + /* (ii) The assignment is in the main program; or */ +- if (gfc_current_ns->proc_name->attr.is_main_program) ++ if (gfc_current_ns->proc_name ++ && gfc_current_ns->proc_name->attr.is_main_program) + bad_proc = true; + + /* (iii) A module or internal procedure... */ +- if ((gfc_current_ns->proc_name->attr.proc == PROC_INTERNAL +- || gfc_current_ns->proc_name->attr.proc == PROC_MODULE) ++ if (gfc_current_ns->proc_name ++ && (gfc_current_ns->proc_name->attr.proc == PROC_INTERNAL ++ || gfc_current_ns->proc_name->attr.proc == PROC_MODULE) + && gfc_current_ns->parent + && (!(gfc_current_ns->parent->proc_name->attr.function + || gfc_current_ns->parent->proc_name->attr.subroutine) +@@ -3130,7 +3132,8 @@ + || gfc_current_ns->parent->proc_name->attr.is_main_program)) + { + /* ... that is not a function... */ +- if (!gfc_current_ns->proc_name->attr.function) ++ if (gfc_current_ns->proc_name ++ && !gfc_current_ns->proc_name->attr.function) + bad_proc = true; + + /* ... or is not an entry and has a different name. */ +Index: gcc/fortran/scanner.c +=================================================================== +--- a/src/gcc/fortran/scanner.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/scanner.c (.../branches/gcc-5-branch) +@@ -1272,21 +1272,11 @@ + are still in a string and we are looking for a possible + doubled quote and we end up here. See PR64506. */ + +- if (in_string) ++ if (in_string && c != '\n') + { + gfc_current_locus = old_loc; +- +- if (c == '!') +- { +- skip_comment_line (); +- goto restart; +- } +- +- if (c != '\n') +- { +- c = '&'; +- goto done; +- } ++ c = '&'; ++ goto done; + } + + if (c != '!' && c != '\n') +@@ -1392,6 +1382,8 @@ + "Missing %<&%> in continued character " + "constant at %C"); + } ++ else if (!in_string && (c == '\'' || c == '"')) ++ goto done; + /* Both !$omp and !$ -fopenmp continuation lines have & on the + continuation line only optionally. */ + else if (openmp_flag || openacc_flag || openmp_cond_flag) +Index: gcc/fortran/io.c +=================================================================== +--- a/src/gcc/fortran/io.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/io.c (.../branches/gcc-5-branch) +@@ -385,7 +385,7 @@ + + if (c == delim) + { +- c = next_char (INSTRING_NOWARN); ++ c = next_char (NONSTRING); + + if (c == '\0') + { +@@ -2382,9 +2382,7 @@ + if (m == MATCH_NO) + { + m = gfc_match_expr (&fp->unit); +- if (m == MATCH_ERROR) +- goto done; +- if (m == MATCH_NO) ++ if (m == MATCH_ERROR || m == MATCH_NO) + goto syntax; + } + +Index: gcc/fortran/match.c +=================================================================== +--- a/src/gcc/fortran/match.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/match.c (.../branches/gcc-5-branch) +@@ -110,6 +110,9 @@ + case INTRINSIC_PARENTHESES: + return "parens"; + ++ case INTRINSIC_NONE: ++ return "none"; ++ + default: + break; + } +Index: gcc/fortran/parse.c +=================================================================== +--- a/src/gcc/fortran/parse.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/parse.c (.../branches/gcc-5-branch) +@@ -2425,8 +2425,7 @@ + break; + + default: +- gfc_internal_error ("Unexpected %s statement in verify_st_order() at %C", +- gfc_ascii_statement (st)); ++ return false; + } + + /* All is well, record the statement in case we need it next time. */ +Index: gcc/fortran/check.c +=================================================================== +--- a/src/gcc/fortran/check.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/fortran/check.c (.../branches/gcc-5-branch) +@@ -6213,6 +6213,15 @@ + bool + gfc_check_storage_size (gfc_expr *a, gfc_expr *kind) + { ++ ++ if (a->expr_type == EXPR_NULL) ++ { ++ gfc_error ("Intrinsic function NULL at %L cannot be an actual " ++ "argument to STORAGE_SIZE, because it returns a " ++ "disassociated pointer", &a->where); ++ return false; ++ } ++ + if (a->ts.type == BT_ASSUMED) + { + gfc_error ("%qs argument of %qs intrinsic at %L shall not be TYPE(*)", Index: gcc/configure.ac =================================================================== --- a/src/gcc/configure.ac (.../tags/gcc_5_1_0_release) @@ -10107,6 +11540,374 @@ Index: gcc/BASE-VER @@ -1 +1 @@ -5.1.0 +5.1.1 +Index: gcc/gimplify.c +=================================================================== +--- a/src/gcc/gimplify.c (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/gimplify.c (.../branches/gcc-5-branch) +@@ -111,6 +111,9 @@ + /* Flag for GOVD_MAP: don't copy back. */ + GOVD_MAP_TO_ONLY = 8192, + ++ /* Flag for GOVD_LINEAR or GOVD_LASTPRIVATE: no outer reference. */ ++ GOVD_LINEAR_LASTPRIVATE_NO_OUTER = 16384, ++ + GOVD_DATA_SHARE_CLASS = (GOVD_SHARED | GOVD_PRIVATE | GOVD_FIRSTPRIVATE + | GOVD_LASTPRIVATE | GOVD_REDUCTION | GOVD_LINEAR + | GOVD_LOCAL) +@@ -126,6 +129,7 @@ + ORT_TASK = 4, + ORT_UNTIED_TASK = 5, + ORT_TEAMS = 8, ++ ORT_COMBINED_TEAMS = 9, + /* Data region. */ + ORT_TARGET_DATA = 16, + /* Data region with offloading. */ +@@ -5842,7 +5846,7 @@ + DECL_NAME (lang_hooks.decls.omp_report_decl (decl))); + error_at (ctx->location, "enclosing task"); + } +- else if (ctx->region_type == ORT_TEAMS) ++ else if (ctx->region_type & ORT_TEAMS) + { + error ("%qE not specified in enclosing teams construct", + DECL_NAME (lang_hooks.decls.omp_report_decl (decl))); +@@ -5935,6 +5939,13 @@ + need to propagate anything to an outer context. */ + if ((flags & GOVD_PRIVATE) && !(flags & GOVD_PRIVATE_OUTER_REF)) + return ret; ++ if ((flags & (GOVD_LINEAR | GOVD_LINEAR_LASTPRIVATE_NO_OUTER)) ++ == (GOVD_LINEAR | GOVD_LINEAR_LASTPRIVATE_NO_OUTER)) ++ return ret; ++ if ((flags & (GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE ++ | GOVD_LINEAR_LASTPRIVATE_NO_OUTER)) ++ == (GOVD_LASTPRIVATE | GOVD_LINEAR_LASTPRIVATE_NO_OUTER)) ++ return ret; + if (ctx->outer_context + && omp_notice_variable (ctx->outer_context, decl, in_code)) + return true; +@@ -6034,6 +6045,36 @@ + return false; + } + ++/* Return true if the CTX is combined with distribute and thus ++ lastprivate can't be supported. */ ++ ++static bool ++omp_no_lastprivate (struct gimplify_omp_ctx *ctx) ++{ ++ do ++ { ++ if (ctx->outer_context == NULL) ++ return false; ++ ctx = ctx->outer_context; ++ switch (ctx->region_type) ++ { ++ case ORT_WORKSHARE: ++ if (!ctx->combined_loop) ++ return false; ++ if (ctx->distribute) ++ return true; ++ break; ++ case ORT_COMBINED_PARALLEL: ++ break; ++ case ORT_COMBINED_TEAMS: ++ return true; ++ default: ++ return false; ++ } ++ } ++ while (1); ++} ++ + /* Scan the OMP clauses in *LIST_P, installing mappings into a new + and previous omp contexts. */ + +@@ -6077,6 +6118,35 @@ + case OMP_CLAUSE_LASTPRIVATE: + flags = GOVD_LASTPRIVATE | GOVD_SEEN | GOVD_EXPLICIT; + check_non_private = "lastprivate"; ++ decl = OMP_CLAUSE_DECL (c); ++ if (omp_no_lastprivate (ctx)) ++ { ++ notice_outer = false; ++ flags |= GOVD_LINEAR_LASTPRIVATE_NO_OUTER; ++ } ++ else if (error_operand_p (decl)) ++ goto do_add; ++ else if (outer_ctx ++ && outer_ctx->region_type == ORT_COMBINED_PARALLEL ++ && splay_tree_lookup (outer_ctx->variables, ++ (splay_tree_key) decl) == NULL) ++ omp_add_variable (outer_ctx, decl, GOVD_SHARED | GOVD_SEEN); ++ else if (outer_ctx ++ && outer_ctx->region_type == ORT_WORKSHARE ++ && outer_ctx->combined_loop ++ && splay_tree_lookup (outer_ctx->variables, ++ (splay_tree_key) decl) == NULL ++ && !omp_check_private (outer_ctx, decl, false)) ++ { ++ omp_add_variable (outer_ctx, decl, GOVD_LASTPRIVATE | GOVD_SEEN); ++ if (outer_ctx->outer_context ++ && (outer_ctx->outer_context->region_type ++ == ORT_COMBINED_PARALLEL) ++ && splay_tree_lookup (outer_ctx->outer_context->variables, ++ (splay_tree_key) decl) == NULL) ++ omp_add_variable (outer_ctx->outer_context, decl, ++ GOVD_SHARED | GOVD_SEEN); ++ } + goto do_add; + case OMP_CLAUSE_REDUCTION: + flags = GOVD_REDUCTION | GOVD_SEEN | GOVD_EXPLICIT; +@@ -6089,7 +6159,68 @@ + remove = true; + break; + } ++ else ++ { ++ /* For combined #pragma omp parallel for simd, need to put ++ lastprivate and perhaps firstprivate too on the ++ parallel. Similarly for #pragma omp for simd. */ ++ struct gimplify_omp_ctx *octx = outer_ctx; ++ decl = NULL_TREE; ++ if (omp_no_lastprivate (ctx)) ++ OMP_CLAUSE_LINEAR_NO_COPYOUT (c) = 1; ++ do ++ { ++ if (OMP_CLAUSE_LINEAR_NO_COPYIN (c) ++ && OMP_CLAUSE_LINEAR_NO_COPYOUT (c)) ++ break; ++ decl = OMP_CLAUSE_DECL (c); ++ if (error_operand_p (decl)) ++ { ++ decl = NULL_TREE; ++ break; ++ } ++ if (octx ++ && octx->region_type == ORT_WORKSHARE ++ && octx->combined_loop) ++ { ++ if (octx->outer_context ++ && (octx->outer_context->region_type ++ == ORT_COMBINED_PARALLEL ++ || (octx->outer_context->region_type ++ == ORT_COMBINED_TEAMS))) ++ octx = octx->outer_context; ++ else if (omp_check_private (octx, decl, false)) ++ break; ++ } ++ else ++ break; ++ gcc_checking_assert (splay_tree_lookup (octx->variables, ++ (splay_tree_key) ++ decl) == NULL); ++ flags = GOVD_SEEN; ++ if (!OMP_CLAUSE_LINEAR_NO_COPYIN (c)) ++ flags |= GOVD_FIRSTPRIVATE; ++ if (!OMP_CLAUSE_LINEAR_NO_COPYOUT (c)) ++ flags |= GOVD_LASTPRIVATE; ++ omp_add_variable (octx, decl, flags); ++ if (octx->outer_context == NULL) ++ break; ++ octx = octx->outer_context; ++ } ++ while (1); ++ if (octx ++ && decl ++ && (!OMP_CLAUSE_LINEAR_NO_COPYIN (c) ++ || !OMP_CLAUSE_LINEAR_NO_COPYOUT (c))) ++ omp_notice_variable (octx, decl, true); ++ } + flags = GOVD_LINEAR | GOVD_EXPLICIT; ++ if (OMP_CLAUSE_LINEAR_NO_COPYIN (c) ++ && OMP_CLAUSE_LINEAR_NO_COPYOUT (c)) ++ { ++ notice_outer = false; ++ flags |= GOVD_LINEAR_LASTPRIVATE_NO_OUTER; ++ } + goto do_add; + + case OMP_CLAUSE_MAP: +@@ -6543,34 +6674,6 @@ + OMP_CLAUSE_SET_CODE (c, OMP_CLAUSE_PRIVATE); + OMP_CLAUSE_PRIVATE_DEBUG (c) = 1; + } +- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR +- && ctx->outer_context +- && !(OMP_CLAUSE_LINEAR_NO_COPYIN (c) +- && OMP_CLAUSE_LINEAR_NO_COPYOUT (c))) +- { +- if (ctx->outer_context->combined_loop +- && !OMP_CLAUSE_LINEAR_NO_COPYIN (c)) +- { +- n = splay_tree_lookup (ctx->outer_context->variables, +- (splay_tree_key) decl); +- if (n == NULL +- || (n->value & GOVD_DATA_SHARE_CLASS) == 0) +- { +- int flags = GOVD_FIRSTPRIVATE; +- /* #pragma omp distribute does not allow +- lastprivate clause. */ +- if (!ctx->outer_context->distribute) +- flags |= GOVD_LASTPRIVATE; +- if (n == NULL) +- omp_add_variable (ctx->outer_context, decl, +- flags | GOVD_SEEN); +- else +- n->value |= flags | GOVD_SEEN; +- } +- } +- else if (!is_global_var (decl)) +- omp_notice_variable (ctx->outer_context, decl, true); +- } + } + break; + +@@ -6581,6 +6684,13 @@ + n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl); + OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c) + = (n->value & GOVD_FIRSTPRIVATE) != 0; ++ if (omp_no_lastprivate (ctx)) ++ { ++ if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c)) ++ remove = true; ++ else ++ OMP_CLAUSE_CODE (c) = OMP_CLAUSE_PRIVATE; ++ } + break; + + case OMP_CLAUSE_ALIGNED: +@@ -6895,6 +7005,22 @@ + gcc_unreachable (); + } + ++ /* Set OMP_CLAUSE_LINEAR_NO_COPYIN flag on explicit linear ++ clause for the IV. */ ++ if (simd && TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) == 1) ++ { ++ t = TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), 0); ++ gcc_assert (TREE_CODE (t) == MODIFY_EXPR); ++ decl = TREE_OPERAND (t, 0); ++ for (tree c = OMP_FOR_CLAUSES (for_stmt); c; c = OMP_CLAUSE_CHAIN (c)) ++ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR ++ && OMP_CLAUSE_DECL (c) == decl) ++ { ++ OMP_CLAUSE_LINEAR_NO_COPYIN (c) = 1; ++ break; ++ } ++ } ++ + gimplify_scan_omp_clauses (&OMP_FOR_CLAUSES (for_stmt), pre_p, + simd ? ORT_SIMD : ORT_WORKSHARE); + if (TREE_CODE (for_stmt) == OMP_DISTRIBUTE) +@@ -6969,39 +7095,68 @@ + { + c = build_omp_clause (input_location, OMP_CLAUSE_LINEAR); + OMP_CLAUSE_LINEAR_NO_COPYIN (c) = 1; +- if (has_decl_expr +- && bitmap_bit_p (has_decl_expr, DECL_UID (decl))) +- OMP_CLAUSE_LINEAR_NO_COPYOUT (c) = 1; ++ unsigned int flags = GOVD_LINEAR | GOVD_EXPLICIT | GOVD_SEEN; ++ if ((has_decl_expr ++ && bitmap_bit_p (has_decl_expr, DECL_UID (decl))) ++ || omp_no_lastprivate (gimplify_omp_ctxp)) ++ { ++ OMP_CLAUSE_LINEAR_NO_COPYOUT (c) = 1; ++ flags |= GOVD_LINEAR_LASTPRIVATE_NO_OUTER; ++ } + OMP_CLAUSE_DECL (c) = decl; + OMP_CLAUSE_CHAIN (c) = OMP_FOR_CLAUSES (for_stmt); + OMP_FOR_CLAUSES (for_stmt) = c; +- omp_add_variable (gimplify_omp_ctxp, decl, +- GOVD_LINEAR | GOVD_EXPLICIT | GOVD_SEEN); ++ ++ omp_add_variable (gimplify_omp_ctxp, decl, flags); ++ struct gimplify_omp_ctx *outer ++ = gimplify_omp_ctxp->outer_context; ++ if (outer && !OMP_CLAUSE_LINEAR_NO_COPYOUT (c)) ++ { ++ if (outer->region_type == ORT_WORKSHARE ++ && outer->combined_loop) ++ { ++ if (outer->outer_context ++ && (outer->outer_context->region_type ++ == ORT_COMBINED_PARALLEL)) ++ outer = outer->outer_context; ++ else if (omp_check_private (outer, decl, false)) ++ outer = NULL; ++ } ++ else if (outer->region_type != ORT_COMBINED_PARALLEL) ++ outer = NULL; ++ if (outer) ++ { ++ omp_add_variable (outer, decl, ++ GOVD_LASTPRIVATE | GOVD_SEEN); ++ if (outer->outer_context) ++ omp_notice_variable (outer->outer_context, decl, true); ++ } ++ } + } + else + { + bool lastprivate + = (!has_decl_expr +- || !bitmap_bit_p (has_decl_expr, DECL_UID (decl))); +- if (lastprivate +- && gimplify_omp_ctxp->outer_context +- && gimplify_omp_ctxp->outer_context->region_type +- == ORT_WORKSHARE +- && gimplify_omp_ctxp->outer_context->combined_loop +- && !gimplify_omp_ctxp->outer_context->distribute) ++ || !bitmap_bit_p (has_decl_expr, DECL_UID (decl))) ++ && !omp_no_lastprivate (gimplify_omp_ctxp); ++ struct gimplify_omp_ctx *outer ++ = gimplify_omp_ctxp->outer_context; ++ if (outer && lastprivate) + { +- struct gimplify_omp_ctx *outer +- = gimplify_omp_ctxp->outer_context; +- n = splay_tree_lookup (outer->variables, +- (splay_tree_key) decl); +- if (n != NULL +- && (n->value & GOVD_DATA_SHARE_CLASS) == GOVD_LOCAL) +- lastprivate = false; +- else if (omp_check_private (outer, decl, false)) +- error ("lastprivate variable %qE is private in outer " +- "context", DECL_NAME (decl)); +- else ++ if (outer->region_type == ORT_WORKSHARE ++ && outer->combined_loop) + { ++ if (outer->outer_context ++ && (outer->outer_context->region_type ++ == ORT_COMBINED_PARALLEL)) ++ outer = outer->outer_context; ++ else if (omp_check_private (outer, decl, false)) ++ outer = NULL; ++ } ++ else if (outer->region_type != ORT_COMBINED_PARALLEL) ++ outer = NULL; ++ if (outer) ++ { + omp_add_variable (outer, decl, + GOVD_LASTPRIVATE | GOVD_SEEN); + if (outer->outer_context) +@@ -7008,6 +7163,7 @@ + omp_notice_variable (outer->outer_context, decl, true); + } + } ++ + c = build_omp_clause (input_location, + lastprivate ? OMP_CLAUSE_LASTPRIVATE + : OMP_CLAUSE_PRIVATE); +@@ -7299,7 +7455,7 @@ + ort = ORT_TARGET_DATA; + break; + case OMP_TEAMS: +- ort = ORT_TEAMS; ++ ort = OMP_TEAMS_COMBINED (expr) ? ORT_COMBINED_TEAMS : ORT_TEAMS; + break; + default: + gcc_unreachable (); Index: gcc/lra-constraints.c =================================================================== --- a/src/gcc/lra-constraints.c (.../tags/gcc_5_1_0_release) @@ -626794,6 +628595,18 @@ Index: gcc/po/zh_CN.po #~ msgid "both %<const%> and %<constexpr%> cannot be used here" #~ msgstr "不能在这里同时使用%<const%>和%<constexpr%>" +Index: gcc/config.gcc +=================================================================== +--- a/src/gcc/config.gcc (.../tags/gcc_5_1_0_release) ++++ b/src/gcc/config.gcc (.../branches/gcc-5-branch) +@@ -2351,6 +2351,7 @@ + maybe_biarch=${cpu_is_64bit} + case ${enable_targets} in + *powerpc64*) maybe_biarch=yes ;; ++ all) maybe_biarch=yes ;; + esac + case ${target} in + powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*) Index: gcc/Makefile.in =================================================================== --- a/src/gcc/Makefile.in (.../tags/gcc_5_1_0_release) @@ -627161,7 +628974,62 @@ Index: gcc/config/i386/i386.c regno = FIRST_SSE_REG; } -@@ -51606,7 +51653,7 @@ +@@ -46892,15 +46939,16 @@ + static bool + expand_vec_perm_blend (struct expand_vec_perm_d *d) + { +- machine_mode vmode = d->vmode; ++ machine_mode mmode, vmode = d->vmode; + unsigned i, mask, nelt = d->nelt; +- rtx target, op0, op1, x; ++ rtx target, op0, op1, maskop, x; + rtx rperm[32], vperm; + + if (d->one_operand_p) + return false; + if (TARGET_AVX512F && GET_MODE_SIZE (vmode) == 64 +- && GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4) ++ && (TARGET_AVX512BW ++ || GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4)) + ; + else if (TARGET_AVX2 && GET_MODE_SIZE (vmode) == 32) + ; +@@ -47074,8 +47122,33 @@ + gcc_unreachable (); + } + ++ switch (vmode) ++ { ++ case V8DFmode: ++ case V8DImode: ++ mmode = QImode; ++ break; ++ case V16SFmode: ++ case V16SImode: ++ mmode = HImode; ++ break; ++ case V32HImode: ++ mmode = SImode; ++ break; ++ case V64QImode: ++ mmode = DImode; ++ break; ++ default: ++ mmode = VOIDmode; ++ } ++ ++ if (mmode != VOIDmode) ++ maskop = force_reg (mmode, gen_int_mode (mask, mmode)); ++ else ++ maskop = GEN_INT (mask); ++ + /* This matches five different patterns with the different modes. */ +- x = gen_rtx_VEC_MERGE (vmode, op1, op0, GEN_INT (mask)); ++ x = gen_rtx_VEC_MERGE (vmode, op1, op0, maskop); + x = gen_rtx_SET (VOIDmode, target, x); + emit_insn (x); + if (target != d->target) +@@ -51606,7 +51679,7 @@ for (i = 0; i < loop->num_nodes; i++) FOR_BB_INSNS (bbs[i], insn) if (NONDEBUG_INSN_P (insn)) @@ -636872,3 +638740,367 @@ Index: libcpp/po/zh_CN.po msgid "syntax error in macro parameter list" msgstr "宏参数列表语法错误" +Index: fixincludes/ChangeLog +=================================================================== +--- a/src/fixincludes/ChangeLog (.../tags/gcc_5_1_0_release) ++++ b/src/fixincludes/ChangeLog (.../branches/gcc-5-branch) +@@ -1,3 +1,15 @@ ++2015-05-22 David Edelsohn <dje.gcc@gmail.com> ++ ++ Backport from mainline. ++ 2015-05-21 David Edelsohn <dje.gcc@gmail.com> ++ ++ * inclhack.def (aix_externc): New fix. ++ (aix_externcpp[12]): New fix. ++ * fixincl.x: Regenerate. ++ * test/base/ctype.h [AIX_EXTERNC_CHECK]: New test. ++ * test/base/sys/socket.h [AIX_EXTERNCPP[12]_CHECK]: New test. ++ * test/base/fcntl.h: New file. ++ + 2015-04-22 Release Manager + + * GCC 5.1.0 released. +Index: fixincludes/tests/base/sys/socket.h +=================================================================== +--- a/src/fixincludes/tests/base/sys/socket.h (.../tags/gcc_5_1_0_release) ++++ b/src/fixincludes/tests/base/sys/socket.h (.../branches/gcc-5-branch) +@@ -9,6 +9,18 @@ + + + ++#if defined( AIX_EXTERNCPP1_CHECK ) ++#ifdef __cplusplus ++extern "C++" { ++#endif /* AIX_EXTERNCPP1_CHECK */ ++ ++ ++#if defined( AIX_EXTERNCPP2_CHECK ) ++} /* extern "C++" */ ++#else /* __cplusplus */ ++#endif /* AIX_EXTERNCPP2_CHECK */ ++ ++ + #if defined( HPUX11_EXTERN_SENDFILE_CHECK ) + #ifndef _APP32_64BIT_OFF_T + extern sbsize_t sendfile __((int, int, off_t, bsize_t, +Index: fixincludes/tests/base/fcntl.h +=================================================================== +--- a/src/fixincludes/tests/base/fcntl.h (.../tags/gcc_5_1_0_release) ++++ b/src/fixincludes/tests/base/fcntl.h (.../branches/gcc-5-branch) +@@ -0,0 +1,25 @@ ++/* DO NOT EDIT THIS FILE. ++ ++ It has been auto-edited by fixincludes from: ++ ++ "fixinc/tests/inc/fcntl.h" ++ ++ This had to be done to correct non-standard usages in the ++ original, manufacturer supplied header file. */ ++ ++#ifndef FIXINC_WRAP_FCNTL_H_AIX_EXTERNC ++#define FIXINC_WRAP_FCNTL_H_AIX_EXTERNC 1 ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++#if defined( AAB_AIX_FCNTL_CHECK ) ++ ++#endif /* AAB_AIX_FCNTL_CHECK */ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* FIXINC_WRAP_FCNTL_H_AIX_EXTERNC */ +Index: fixincludes/tests/base/ctype.h +=================================================================== +--- a/src/fixincludes/tests/base/ctype.h (.../tags/gcc_5_1_0_release) ++++ b/src/fixincludes/tests/base/ctype.h (.../branches/gcc-5-branch) +@@ -7,8 +7,20 @@ + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + ++#ifndef FIXINC_WRAP_CTYPE_H_AIX_EXTERNC ++#define FIXINC_WRAP_CTYPE_H_AIX_EXTERNC 1 + ++#ifdef __cplusplus ++extern "C" { ++#endif + ++ ++#if defined( AIX_EXTERNC_CHECK ) ++extern int __n_pthreads; ++ ++#endif /* AIX_EXTERNC_CHECK */ ++ ++ + #if defined( HPUX10_CTYPE_DECLARATIONS1_CHECK ) + #ifdef _PROTOTYPES + extern int __tolower(int); +@@ -63,3 +75,8 @@ + # define isalpha(__c) (__SB_masks ? (int)__SB_masks[__c] & _IS + + #endif /* HPUX_CTYPE_MACROS_CHECK */ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* FIXINC_WRAP_CTYPE_H_AIX_EXTERNC */ +Index: fixincludes/fixincl.x +=================================================================== +--- a/src/fixincludes/fixincl.x (.../tags/gcc_5_1_0_release) ++++ b/src/fixincludes/fixincl.x (.../branches/gcc-5-branch) +@@ -2,11 +2,11 @@ + * + * DO NOT EDIT THIS FILE (fixincl.x) + * +- * It has been AutoGen-ed Saturday March 28, 2015 at 01:24:12 PM EDT ++ * It has been AutoGen-ed May 21, 2015 at 02:48:12 AM by AutoGen 5.18.3 + * From the definitions inclhack.def + * and the template file fixincl + */ +-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 28 Mar 2015 13:24:12 EDT ++/* DO NOT SVN-MERGE THIS FILE, EITHER Thu May 21 02:48:12 UTC 2015 + * + * You must regenerate it. Use the ./genfixes script. + * +@@ -15,7 +15,7 @@ + * certain ANSI-incompatible system header files which are fixed to work + * correctly with ANSI C and placed in a directory that GNU C will search. + * +- * This file contains 226 fixup descriptions. ++ * This file contains 229 fixup descriptions. + * + * See README for more information. + * +@@ -812,6 +812,124 @@ + + /* * * * * * * * * * * * * * * * * * * * * * * * * * + * ++ * Description of Aix_Externc fix ++ */ ++tSCC zAix_ExterncName[] = ++ "aix_externc"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zAix_ExterncList[] = ++ "ctype.h\0fcntl.h\0langinfo.h\0ldfcn.h\0sys/localedef.h\0sys/times.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzAix_ExterncMachs[] = { ++ "*-*-aix*", ++ (const char*)NULL }; ++ ++/* ++ * content bypass pattern - skip fix if pattern found ++ */ ++tSCC zAix_ExterncBypass0[] = ++ "extern \"C\""; ++ ++#define AIX_EXTERNC_TEST_CT 1 ++static tTestDesc aAix_ExterncTests[] = { ++ { TT_NEGREP, zAix_ExterncBypass0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Aix_Externc ++ */ ++static const char* apzAix_ExterncPatch[] = { ++ "wrap", ++ "#ifdef __cplusplus\n\ ++extern \"C\" {\n\ ++#endif\n", ++ "#ifdef __cplusplus\n\ ++}\n\ ++#endif\n", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * ++ * Description of Aix_Externcpp1 fix ++ */ ++tSCC zAix_Externcpp1Name[] = ++ "aix_externcpp1"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zAix_Externcpp1List[] = ++ "sys/socket.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzAix_Externcpp1Machs[] = { ++ "*-*-aix*", ++ (const char*)NULL }; ++ ++/* ++ * content selection pattern - do fix if pattern found ++ */ ++tSCC zAix_Externcpp1Select0[] = ++ "#ifdef __cplusplus"; ++ ++#define AIX_EXTERNCPP1_TEST_CT 1 ++static tTestDesc aAix_Externcpp1Tests[] = { ++ { TT_EGREP, zAix_Externcpp1Select0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Aix_Externcpp1 ++ */ ++static const char* apzAix_Externcpp1Patch[] = { ++ "format", ++ "#ifdef __cplusplus\n\ ++extern \"C++\" {", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * ++ * Description of Aix_Externcpp2 fix ++ */ ++tSCC zAix_Externcpp2Name[] = ++ "aix_externcpp2"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zAix_Externcpp2List[] = ++ "sys/socket.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzAix_Externcpp2Machs[] = { ++ "*-*-aix*", ++ (const char*)NULL }; ++ ++/* ++ * content selection pattern - do fix if pattern found ++ */ ++tSCC zAix_Externcpp2Select0[] = ++ "#else /\\* __cplusplus \\*/"; ++ ++#define AIX_EXTERNCPP2_TEST_CT 1 ++static tTestDesc aAix_Externcpp2Tests[] = { ++ { TT_EGREP, zAix_Externcpp2Select0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Aix_Externcpp2 ++ */ ++static const char* apzAix_Externcpp2Patch[] = { ++ "format", ++ "} /* extern \"C++\" */\n\ ++#else /* __cplusplus */", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * + * Description of Aix_Malloc fix + */ + tSCC zAix_MallocName[] = +@@ -9278,9 +9396,9 @@ + * + * List of all fixes + */ +-#define REGEX_COUNT 263 ++#define REGEX_COUNT 266 + #define MACH_LIST_SIZE_LIMIT 187 +-#define FIX_COUNT 226 ++#define FIX_COUNT 229 + + /* + * Enumerate the fixes +@@ -9300,6 +9418,9 @@ + AAB_VXWORKS_UNISTD_FIXIDX, + AIX_ASSERT_FIXIDX, + AIX_COMPLEX_FIXIDX, ++ AIX_EXTERNC_FIXIDX, ++ AIX_EXTERNCPP1_FIXIDX, ++ AIX_EXTERNCPP2_FIXIDX, + AIX_MALLOC_FIXIDX, + AIX_NET_IF_ARP_FIXIDX, + AIX_NULL_FIXIDX, +@@ -9585,6 +9706,21 @@ + AIX_COMPLEX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aAix_ComplexTests, apzAix_ComplexPatch, 0 }, + ++ { zAix_ExterncName, zAix_ExterncList, ++ apzAix_ExterncMachs, ++ AIX_EXTERNC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ++ aAix_ExterncTests, apzAix_ExterncPatch, 0 }, ++ ++ { zAix_Externcpp1Name, zAix_Externcpp1List, ++ apzAix_Externcpp1Machs, ++ AIX_EXTERNCPP1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ++ aAix_Externcpp1Tests, apzAix_Externcpp1Patch, 0 }, ++ ++ { zAix_Externcpp2Name, zAix_Externcpp2List, ++ apzAix_Externcpp2Machs, ++ AIX_EXTERNCPP2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ++ aAix_Externcpp2Tests, apzAix_Externcpp2Patch, 0 }, ++ + { zAix_MallocName, zAix_MallocList, + apzAix_MallocMachs, + AIX_MALLOC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, +Index: fixincludes/inclhack.def +=================================================================== +--- a/src/fixincludes/inclhack.def (.../tags/gcc_5_1_0_release) ++++ b/src/fixincludes/inclhack.def (.../branches/gcc-5-branch) +@@ -597,6 +597,56 @@ + }; + + /* ++ * On AIX some headers are not properly guarded by 'extern "C"'. ++ */ ++fix = { ++ hackname = aix_externc; ++ mach = "*-*-aix*"; ++ files = ctype.h; ++ files = fcntl.h; ++ files = langinfo.h; ++ files = ldfcn.h; ++ files = sys/localedef.h; ++ files = sys/times.h; ++ bypass = "extern \"C\""; ++ c_fix = wrap; ++ c_fix_arg = "#ifdef __cplusplus\n" ++ "extern \"C\" {\n" ++ "#endif\n"; ++ c_fix_arg = "#ifdef __cplusplus\n" ++ "}\n" ++ "#endif\n"; ++ test_text = "extern int __n_pthreads;\n"; ++}; ++ ++/* ++ * On AIX sys/socket.h assumes C++. ++ */ ++fix = { ++ hackname = aix_externcpp1; ++ mach = "*-*-aix*"; ++ files = "sys/socket.h"; ++ select = "#ifdef __cplusplus"; ++ c_fix = format; ++ c_fix_arg = "#ifdef __cplusplus\n" ++ "extern \"C++\" {"; ++ test_text = "#ifdef __cplusplus"; ++ ++}; ++ ++fix = { ++ hackname = aix_externcpp2; ++ mach = "*-*-aix*"; ++ files = "sys/socket.h"; ++ select = "#else /\\* __cplusplus \\*/"; ++ c_fix = format; ++ c_fix_arg = "} /* extern \"C++\" */\n" ++ "#else /* __cplusplus */"; ++ test_text = "#else /* __cplusplus */"; ++ ++}; ++ ++/* + * malloc.h on AIX6 uses XLC++ specific builtin syntax + */ + fix = { |