diff options
author | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2014-04-25 09:49:12 +0000 |
---|---|---|
committer | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2014-04-25 09:49:12 +0000 |
commit | 895aa02b0046bd7a0ad4fbcea8c9f0dfd56a31b0 (patch) | |
tree | 1242a060c5a68dc262916a5790899d7cc77fb3a4 /debian/patches/svn-updates.diff | |
parent | 7ab0a5c333ab12639e95f4c2312ab8d3bb8e3540 (diff) | |
download | gcc-49-895aa02b0046bd7a0ad4fbcea8c9f0dfd56a31b0.tar.gz |
* Update to SVN 20140425 (r209789) from the gcc-4_9-branch.
git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.9@7314 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian/patches/svn-updates.diff')
-rw-r--r-- | debian/patches/svn-updates.diff | 1298 |
1 files changed, 1266 insertions, 32 deletions
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff index 3f0b8a5..52b1418 100644 --- a/debian/patches/svn-updates.diff +++ b/debian/patches/svn-updates.diff @@ -1,10 +1,10 @@ -# DP: updates from the 4.9 branch upto 20140424 (r209755). +# DP: updates from the 4.9 branch upto 20140425 (r209789). last_updated() { cat > ${dir}LAST_UPDATED <<EOF -Thu Apr 24 18:30:09 CEST 2014 -Thu Apr 24 16:30:09 UTC 2014 (revision 209755) +Fri Apr 25 11:40:42 CEST 2014 +Fri Apr 25 09:40:42 UTC 2014 (revision 209789) EOF } @@ -12,6 +12,568 @@ LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_9_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_4_9_0_release) ++++ b/src/libgomp/ChangeLog (.../branches/gcc-4_9-branch) +@@ -1,3 +1,15 @@ ++2014-04-24 Jakub Jelinek <jakub@redhat.com> ++ ++ * testsuite/libgomp.c++/atomic-14.C: Allow seq_cst and ++ atomic type clauses in any order and optional comma in between. ++ * testsuite/libgomp.c++/atomic-15.C: Likewise. ++ * testsuite/libgomp.c/atomic-17.c: Likewise. ++ ++ * testsuite/libgomp.c/simd-7.c: New test. ++ * testsuite/libgomp.c/simd-8.c: New test. ++ * testsuite/libgomp.c/simd-9.c: New test. ++ * testsuite/libgomp.c/loop-16.c: New test. ++ + 2014-04-22 Release Manager + + * GCC 4.9.0 released. +Index: libgomp/testsuite/libgomp.c++/atomic-15.C +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c++/atomic-15.C (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c++/atomic-15.C (.../branches/gcc-4_9-branch) +@@ -14,13 +14,13 @@ + v = x; + if (v != 3) + abort (); +- #pragma omp atomic update seq_cst ++ #pragma omp atomic seq_cst update + x = 3 * 2 * 1 + x; +- #pragma omp atomic read seq_cst ++ #pragma omp atomic read, seq_cst + v = x; + if (v != 9) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst, capture + v = x = x | 16; + if (v != 25) + abort (); +@@ -28,15 +28,15 @@ + v = x = x + 14 * 2 / 4; + if (v != 32) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + v = x = 5 | x; + if (v != 37) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture, seq_cst + v = x = 40 + 12 - 2 - 7 - x; + if (v != 6) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic seq_cst read + v = x; + if (v != 6) + abort (); +@@ -44,7 +44,7 @@ + { v = x; x = 3 + x; } + if (v != 6) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { v = x; x = -1 * -1 * -1 * -1 - x; } + if (v != 9) + abort (); +@@ -52,11 +52,11 @@ + v = x; + if (v != -8) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture, seq_cst + { x = 2 * 2 - x; v = x; } + if (v != 12) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { x = 7 & x; v = x; } + if (v != 4) + abort (); +@@ -64,7 +64,7 @@ + { v = x; x = 6; } + if (v != 4) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic read, seq_cst + v = x; + if (v != 6) + abort (); +@@ -72,11 +72,11 @@ + { v = x; x = 7 * 8 + 23; } + if (v != 6) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic seq_cst, read + v = x; + if (v != 79) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture , seq_cst + { v = x; x = 23 + 6 * 4; } + if (v != 79) + abort (); +@@ -84,7 +84,7 @@ + v = x; + if (v != 47) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { v = x; x = l ? 17 : 12; } + if (v != 47) + abort (); +Index: libgomp/testsuite/libgomp.c++/atomic-14.C +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c++/atomic-14.C (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c++/atomic-14.C (.../branches/gcc-4_9-branch) +@@ -13,13 +13,13 @@ + v = x; + if (v != 3) + abort (); +- #pragma omp atomic update seq_cst ++ #pragma omp atomic seq_cst update + x = 3 * 2 * 1 + x; +- #pragma omp atomic read seq_cst ++ #pragma omp atomic read, seq_cst + v = x; + if (v != 9) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst, capture + v = x = x | 16; + if (v != 25) + abort (); +@@ -27,15 +27,15 @@ + v = x = x + 14 * 2 / 4; + if (v != 32) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + v = x = 5 | x; + if (v != 37) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture, seq_cst + v = x = 40 + 12 - 2 - 7 - x; + if (v != 6) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic seq_cst read + v = x; + if (v != 6) + abort (); +@@ -43,7 +43,7 @@ + { v = x; x = 3 + x; } + if (v != 6) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { v = x; x = -1 * -1 * -1 * -1 - x; } + if (v != 9) + abort (); +@@ -51,11 +51,11 @@ + v = x; + if (v != -8) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture, seq_cst + { x = 2 * 2 - x; v = x; } + if (v != 12) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { x = 7 & x; v = x; } + if (v != 4) + abort (); +@@ -63,7 +63,7 @@ + { v = x; x = 6; } + if (v != 4) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic read, seq_cst + v = x; + if (v != 6) + abort (); +@@ -71,11 +71,11 @@ + { v = x; x = 7 * 8 + 23; } + if (v != 6) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic seq_cst, read + v = x; + if (v != 79) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture , seq_cst + { v = x; x = 23 + 6 * 4; } + if (v != 79) + abort (); +@@ -83,7 +83,7 @@ + v = x; + if (v != 47) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { v = x; x = l ? 17 : 12; } + if (v != 47) + abort (); +Index: libgomp/testsuite/libgomp.c/simd-9.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/simd-9.c (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/simd-9.c (.../branches/gcc-4_9-branch) +@@ -0,0 +1,70 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2" } */ ++/* { dg-additional-options "-msse2" { target sse2_runtime } } */ ++/* { dg-additional-options "-mavx" { target avx_runtime } } */ ++ ++extern void abort (); ++int a[32][32] __attribute__((aligned (32))) = { { 1 } }; ++struct S { int s; }; ++#pragma omp declare reduction (+:struct S:omp_out.s += omp_in.s) ++#pragma omp declare reduction (foo:struct S:omp_out.s += omp_in.s) ++#pragma omp declare reduction (foo:int:omp_out += omp_in) ++ ++__attribute__((noinline, noclone)) int ++foo (void) ++{ ++ int i, j, u = 0; ++ struct S s, t; ++ s.s = 0; t.s = 0; ++ #pragma omp simd aligned(a : 32) lastprivate (i, j) reduction(+:s) reduction(foo:t, u) collapse(2) ++ for (i = 0; i < 32; i++) ++ for (j = 0; j < 32; j++) ++ { ++ int *q = &i; ++ int *r = &j; ++ int x = a[i][j]; ++ s.s += x; ++ t.s += x; ++ u += x; ++ } ++ if (t.s != s.s || u != s.s || i != 32 || j != 32) ++ abort (); ++ return s.s; ++} ++ ++__attribute__((noinline, noclone)) int ++bar (void) ++{ ++ int i, j, u = 0; ++ struct S s, t; ++ s.s = 0; t.s = 0; ++ #pragma omp simd aligned(a:32)reduction(+:s)reduction(foo:t,u)collapse(2) ++ for (i = 0; i < 32; i++) ++ for (j = 0; j < 32; j++) ++ { ++ int *q = &i; ++ int *r = &j; ++ int x = a[i][j]; ++ s.s += x; ++ t.s += x; ++ u += x; ++ } ++ if (t.s != s.s || u != s.s || i != 32 || j != 32) ++ abort (); ++ return s.s; ++} ++ ++int ++main () ++{ ++ int i, j; ++ for (i = 0; i < 32; i++) ++ for (j = 0; j < 32; j++) ++ a[i][j] = j + (i / 4); ++ int s = foo (); ++ if (s != 19456) ++ abort (); ++ if (bar () != 19456) ++ abort (); ++ return 0; ++} +Index: libgomp/testsuite/libgomp.c/loop-16.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/loop-16.c (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/loop-16.c (.../branches/gcc-4_9-branch) +@@ -0,0 +1,27 @@ ++/* { dg-do run } */ ++ ++extern void abort (void); ++ ++volatile int count; ++static int test (void) ++{ ++ return ++count > 0; ++} ++ ++int i; ++ ++int ++main () ++{ ++ #pragma omp for lastprivate (i) ++ for (i = 0; i < 10; ++i) ++ { ++ int *p = &i; ++ if (test ()) ++ continue; ++ abort (); ++ } ++ if (i != count) ++ abort (); ++ return 0; ++} +Index: libgomp/testsuite/libgomp.c/simd-7.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/simd-7.c (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/simd-7.c (.../branches/gcc-4_9-branch) +@@ -0,0 +1,96 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2" } */ ++/* { dg-additional-options "-msse2" { target sse2_runtime } } */ ++/* { dg-additional-options "-mavx" { target avx_runtime } } */ ++ ++extern void abort (); ++int a[1024] __attribute__((aligned (32))) = { 1 }; ++int b[1024] __attribute__((aligned (32))) = { 1 }; ++int k, m; ++struct U { int u; }; ++struct V { int v; }; ++ ++__attribute__((noinline, noclone)) int ++foo (int *p) ++{ ++ int i, s = 0; ++ struct U u; ++ struct V v; ++ #pragma omp simd aligned(a, p : 32) linear(k: m + 1) \ ++ linear(i) reduction(+:s) lastprivate(u, v) ++ for (i = 0; i < 1024; i++) ++ { ++ int *q = &i; ++ a[i] *= p[i]; ++ u.u = p[i] + k; ++ k += m + 1; ++ v.v = p[i] + k; ++ s += p[i] + k; ++ } ++ if (u.u != 36 + 4 + 3 * 1023 || v.v != 36 + 4 + 3 * 1024 || i != 1024) ++ abort (); ++ return s; ++} ++ ++__attribute__((noinline, noclone)) int ++bar (int *p) ++{ ++ int i, s = 0; ++ struct U u; ++ struct V v; ++ #pragma omp simd aligned(a, p : 32) linear(k: m + 1) \ ++ reduction(+:s) lastprivate(u, v) ++ for (i = 0; i < 1024; i++) ++ { ++ int *q = &i; ++ a[i] *= p[i]; ++ u.u = p[i] + k; ++ k += m + 1; ++ v.v = p[i] + k; ++ s += p[i] + k; ++ } ++ if (u.u != 36 + 4 + 3 * 1023 || v.v != 36 + 4 + 3 * 1024 || i != 1024) ++ abort (); ++ return s; ++} ++ ++int ++main () ++{ ++#if __SIZEOF_INT__ >= 4 ++ int i; ++ k = 4; ++ m = 2; ++ for (i = 0; i < 1024; i++) ++ { ++ a[i] = i - 512; ++ b[i] = (i - 51) % 39; ++ } ++ int s = foo (b); ++ for (i = 0; i < 1024; i++) ++ { ++ if (b[i] != (i - 51) % 39 ++ || a[i] != (i - 512) * b[i]) ++ abort (); ++ } ++ if (k != 4 + 3 * 1024 || s != 1596127) ++ abort (); ++ k = 4; ++ m = 2; ++ for (i = 0; i < 1024; i++) ++ { ++ a[i] = i - 512; ++ b[i] = (i - 51) % 39; ++ } ++ s = bar (b); ++ for (i = 0; i < 1024; i++) ++ { ++ if (b[i] != (i - 51) % 39 ++ || a[i] != (i - 512) * b[i]) ++ abort (); ++ } ++ if (k != 4 + 3 * 1024 || s != 1596127) ++ abort (); ++#endif ++ return 0; ++} +Index: libgomp/testsuite/libgomp.c/atomic-17.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/atomic-17.c (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/atomic-17.c (.../branches/gcc-4_9-branch) +@@ -13,13 +13,13 @@ + v = x; + if (v != 3) + abort (); +- #pragma omp atomic update seq_cst ++ #pragma omp atomic seq_cst update + x = 3 * 2 * 1 + x; +- #pragma omp atomic read seq_cst ++ #pragma omp atomic read, seq_cst + v = x; + if (v != 9) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst, capture + v = x = x | 16; + if (v != 25) + abort (); +@@ -27,15 +27,15 @@ + v = x = x + 14 * 2 / 4; + if (v != 32) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + v = x = 5 | x; + if (v != 37) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture, seq_cst + v = x = 40 + 12 - 2 - 7 - x; + if (v != 6) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic seq_cst read + v = x; + if (v != 6) + abort (); +@@ -43,7 +43,7 @@ + { v = x; x = 3 + x; } + if (v != 6) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { v = x; x = -1 * -1 * -1 * -1 - x; } + if (v != 9) + abort (); +@@ -51,11 +51,11 @@ + v = x; + if (v != -8) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture, seq_cst + { x = 2 * 2 - x; v = x; } + if (v != 12) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { x = 7 & x; v = x; } + if (v != 4) + abort (); +@@ -63,7 +63,7 @@ + { v = x; x = 6; } + if (v != 4) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic read, seq_cst + v = x; + if (v != 6) + abort (); +@@ -71,11 +71,11 @@ + { v = x; x = 7 * 8 + 23; } + if (v != 6) + abort (); +- #pragma omp atomic read seq_cst ++ #pragma omp atomic seq_cst, read + v = x; + if (v != 79) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic capture , seq_cst + { v = x; x = 23 + 6 * 4; } + if (v != 79) + abort (); +@@ -83,7 +83,7 @@ + v = x; + if (v != 47) + abort (); +- #pragma omp atomic capture seq_cst ++ #pragma omp atomic seq_cst capture + { v = x; x = l ? 17 : 12; } + if (v != 47) + abort (); +Index: libgomp/testsuite/libgomp.c/simd-8.c +=================================================================== +--- a/src/libgomp/testsuite/libgomp.c/simd-8.c (.../tags/gcc_4_9_0_release) ++++ b/src/libgomp/testsuite/libgomp.c/simd-8.c (.../branches/gcc-4_9-branch) +@@ -0,0 +1,44 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2" } */ ++/* { dg-additional-options "-msse2" { target sse2_runtime } } */ ++/* { dg-additional-options "-mavx" { target avx_runtime } } */ ++ ++extern void abort (); ++int a[32][32] __attribute__((aligned (32))) = { { 1 } }; ++struct S { int s; }; ++#pragma omp declare reduction (+:struct S:omp_out.s += omp_in.s) ++#pragma omp declare reduction (foo:struct S:omp_out.s += omp_in.s) ++#pragma omp declare reduction (foo:int:omp_out += omp_in) ++ ++__attribute__((noinline, noclone)) int ++foo (void) ++{ ++ int i, j, u = 0; ++ struct S s, t; ++ s.s = 0; t.s = 0; ++ #pragma omp simd aligned(a : 32) reduction(+:s) reduction(foo:t, u) collapse(2) ++ for (i = 0; i < 32; i++) ++ for (j = 0; j < 32; j++) ++ { ++ int x = a[i][j]; ++ s.s += x; ++ t.s += x; ++ u += x; ++ } ++ if (t.s != s.s || u != s.s) ++ abort (); ++ return s.s; ++} ++ ++int ++main () ++{ ++ int i, j; ++ for (i = 0; i < 32; i++) ++ for (j = 0; j < 32; j++) ++ a[i][j] = j + (i / 4); ++ int s = foo (); ++ if (s != 19456) ++ abort (); ++ return 0; ++} Index: gcc/tree-ssa-loop-im.c =================================================================== --- a/src/gcc/tree-ssa-loop-im.c (.../tags/gcc_4_9_0_release) @@ -117,7 +679,13 @@ Index: gcc/c/ChangeLog =================================================================== --- a/src/gcc/c/ChangeLog (.../tags/gcc_4_9_0_release) +++ b/src/gcc/c/ChangeLog (.../branches/gcc-4_9-branch) -@@ -1,3 +1,9 @@ +@@ -1,3 +1,15 @@ ++2014-04-24 Jakub Jelinek <jakub@redhat.com> ++ ++ * c-parser.c (c_parser_omp_atomic): Allow seq_cst before ++ atomic-clause, allow comma in between atomic-clause and ++ seq_cst. ++ +2014-04-22 Jakub Jelinek <jakub@redhat.com> + + PR c/59073 @@ -131,7 +699,53 @@ Index: gcc/c/c-parser.c =================================================================== --- a/src/gcc/c/c-parser.c (.../tags/gcc_4_9_0_release) +++ b/src/gcc/c/c-parser.c (.../branches/gcc-4_9-branch) -@@ -12208,10 +12208,12 @@ +@@ -11198,6 +11198,18 @@ + if (c_parser_next_token_is (parser, CPP_NAME)) + { + const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); ++ if (!strcmp (p, "seq_cst")) ++ { ++ seq_cst = true; ++ c_parser_consume_token (parser); ++ if (c_parser_next_token_is (parser, CPP_COMMA) ++ && c_parser_peek_2nd_token (parser)->type == CPP_NAME) ++ c_parser_consume_token (parser); ++ } ++ } ++ if (c_parser_next_token_is (parser, CPP_NAME)) ++ { ++ const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); + + if (!strcmp (p, "read")) + code = OMP_ATOMIC_READ; +@@ -11212,13 +11224,21 @@ + if (p) + c_parser_consume_token (parser); + } +- if (c_parser_next_token_is (parser, CPP_NAME)) ++ if (!seq_cst) + { +- const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); +- if (!strcmp (p, "seq_cst")) ++ if (c_parser_next_token_is (parser, CPP_COMMA) ++ && c_parser_peek_2nd_token (parser)->type == CPP_NAME) ++ c_parser_consume_token (parser); ++ ++ if (c_parser_next_token_is (parser, CPP_NAME)) + { +- seq_cst = true; +- c_parser_consume_token (parser); ++ const char *p ++ = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); ++ if (!strcmp (p, "seq_cst")) ++ { ++ seq_cst = true; ++ c_parser_consume_token (parser); ++ } + } + } + c_parser_skip_to_pragma_eol (parser); +@@ -12208,10 +12228,12 @@ if (!flag_openmp) /* flag_openmp_simd */ return c_parser_omp_for (loc, parser, p_name, mask, cclauses); block = c_begin_omp_parallel (); @@ -151,7 +765,21 @@ Index: gcc/DATESTAMP +++ b/src/gcc/DATESTAMP (.../branches/gcc-4_9-branch) @@ -1 +1 @@ -20140422 -+20140424 ++20140425 +Index: gcc/tree.h +=================================================================== +--- a/src/gcc/tree.h (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/tree.h (.../branches/gcc-4_9-branch) +@@ -1330,6 +1330,9 @@ + #define OMP_CLAUSE_LINEAR_STEP(NODE) \ + OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR), 1) + ++#define OMP_CLAUSE_LINEAR_GIMPLE_SEQ(NODE) \ ++ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init ++ + #define OMP_CLAUSE_ALIGNED_ALIGNMENT(NODE) \ + OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALIGNED), 1) + Index: gcc/fold-const.c =================================================================== --- a/src/gcc/fold-const.c (.../tags/gcc_4_9_0_release) @@ -178,7 +806,42 @@ Index: gcc/omp-low.c =================================================================== --- a/src/gcc/omp-low.c (.../tags/gcc_4_9_0_release) +++ b/src/gcc/omp-low.c (.../branches/gcc-4_9-branch) -@@ -11291,45 +11291,53 @@ +@@ -1730,6 +1730,9 @@ + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION + && OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)) + scan_array_reductions = true; ++ else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR ++ && OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)) ++ scan_array_reductions = true; + break; + + case OMP_CLAUSE_SHARED: +@@ -1816,6 +1819,9 @@ + else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE + && OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)) + scan_omp (&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c), ctx); ++ else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR ++ && OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)) ++ scan_omp (&OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c), ctx); + } + + /* Create a new name for omp child function. Returns an identifier. */ +@@ -3803,6 +3809,14 @@ + OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)); + OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c) = NULL; + } ++ else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR ++ && OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)) ++ { ++ lower_omp (&OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c), ctx); ++ gimple_seq_add_seq (stmt_list, ++ OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)); ++ OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c) = NULL; ++ } + + x = build_outer_var_ref (var, ctx); + if (is_reference (var)) +@@ -11291,45 +11305,53 @@ ipa_simd_modify_stmt_ops (tree *tp, int *walk_subtrees, void *data) { struct walk_stmt_info *wi = (struct walk_stmt_info *) data; @@ -261,7 +924,7 @@ Index: gcc/omp-low.c { tree vce = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (*tp), repl); *tp = vce; -@@ -11338,8 +11346,6 @@ +@@ -11338,8 +11360,6 @@ *tp = repl; info->modified = true; @@ -270,7 +933,7 @@ Index: gcc/omp-low.c return NULL_TREE; } -@@ -11358,7 +11364,7 @@ +@@ -11358,7 +11378,7 @@ tree retval_array, tree iter) { basic_block bb; @@ -279,7 +942,7 @@ Index: gcc/omp-low.c /* Re-use the adjustments array, but this time use it to replace every function argument use to an offset into the corresponding -@@ -11381,6 +11387,46 @@ +@@ -11381,6 +11401,46 @@ j += node->simdclone->simdlen / TYPE_VECTOR_SUBPARTS (vectype) - 1; } @@ -330,7 +993,38 @@ Index: gcc/ChangeLog =================================================================== --- a/src/gcc/ChangeLog (.../tags/gcc_4_9_0_release) +++ b/src/gcc/ChangeLog (.../branches/gcc-4_9-branch) -@@ -1,3 +1,192 @@ +@@ -1,3 +1,223 @@ ++2014-04-25 Richard Biener <rguenther@suse.de> ++ ++ PR ipa/60912 ++ * tree-ssa-structalias.c (ipa_pta_execute): Compute direct ++ call stmt use/clobber sets during stmt walk instead of ++ walking the possibly incomplete set of caller edges. ++ ++2014-04-25 Richard Biener <rguenther@suse.de> ++ ++ PR ipa/60911 ++ * passes.c (apply_ipa_transforms): Inline into only caller ... ++ (execute_one_pass): ... here. Properly bring in function ++ bodies for nodes we want to apply IPA transforms to. ++ ++2014-04-24 Jakub Jelinek <jakub@redhat.com> ++ ++ * tree.h (OMP_CLAUSE_LINEAR_GIMPLE_SEQ): Define. ++ * gimplify.c (omp_is_private): Change last argument's type to int. ++ Only diagnose lastprivate if the simd argument is 1, only diagnose ++ linear if the simd argument is 2. ++ (gimplify_omp_for): Adjust omp_is_private callers. When adding ++ lastprivate or private, add the clause to OMP_FOR_CLAUSES. Pass ++ GOVD_EXPLICIT to omp_add_variable. For simd with collapse == 1 ++ create OMP_CLAUSE_LINEAR rather than OMP_CLAUSE_PRIVATE for var. ++ If var != decl and decl is in OMP_CLAUSE_LINEAR, gimplify decl ++ increment to OMP_CLAUSE_LINEAR_GIMPLE_SEQ. ++ * omp-low.c (scan_sharing_clauses, lower_lastprivate_clauses): Handle ++ OMP_CLAUSE_LINEAR_GIMPLE_SEQ. ++ * tree-nested.c (convert_nonlocal_omp_clauses, ++ convert_local_omp_clauses): Handle OMP_CLAUSE_LINEAR. ++ +2014-04-23 Uros Bizjak <ubizjak@gmail.com> + + Backport from mainline @@ -523,7 +1217,7 @@ Index: gcc/ChangeLog 2014-04-22 Release Manager * GCC 4.9.0 released. -@@ -59,8 +253,7 @@ +@@ -59,8 +284,7 @@ 2014-04-11 Tobias Burnus <burnus@net-b.de> PR other/59055 @@ -533,7 +1227,7 @@ Index: gcc/ChangeLog * doc/gcc.texi (Service): Update description in the @menu * doc/invoke.texi (Option Summary): Remove misplaced and duplicated @menu. -@@ -86,15 +279,14 @@ +@@ -86,15 +310,14 @@ 2014-04-11 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/60663 @@ -552,7 +1246,7 @@ Index: gcc/ChangeLog 2014-04-10 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> -@@ -212,9 +404,10 @@ +@@ -212,9 +435,10 @@ 2014-04-05 Pitchumani Sivanupandi <Pitchumani.S@atmel.com> @@ -566,7 +1260,7 @@ Index: gcc/ChangeLog * config/avr/avr-c.c (avr_cpu_cpp_builtins): use dev_attribute to check errata_skip. Add __AVR_ISA_RMW__ builtin macro if RMW ISA available. * config/avr/avr-devices.c (avr_mcu_types): Update AVR_MCU macro for -@@ -282,21 +475,21 @@ +@@ -282,21 +506,21 @@ 2014-04-04 Martin Jambor <mjambor@suse.cz> PR ipa/60640 @@ -599,7 +1293,7 @@ Index: gcc/ChangeLog moved setting of a lot of flags to set_new_clone_decl_and_node_flags. 2014-04-04 Jeff Law <law@redhat.com> -@@ -334,8 +527,8 @@ +@@ -334,8 +558,8 @@ PR tree-optimization/60505 * tree-vectorizer.h (struct _stmt_vec_info): Add th field as the @@ -610,7 +1304,7 @@ Index: gcc/ChangeLog * tree-vect-loop.c (new_loop_vec_info): Initialize LOOP_VINFO_COST_MODEL_THRESHOLD. * tree-vect-loop.c (vect_analyze_loop_operations): -@@ -347,8 +540,7 @@ +@@ -347,8 +571,7 @@ 2014-04-03 Richard Biener <rguenther@suse.de> @@ -620,7 +1314,7 @@ Index: gcc/ChangeLog (streamer_tree_cache_create): Adjust. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Adjust to allow optional nodes array. -@@ -359,8 +551,7 @@ +@@ -359,8 +582,7 @@ * lto-streamer-out.c (create_output_block): Avoid maintaining the node array in the writer cache. (DFS_write_tree): Remove assertion. @@ -630,7 +1324,7 @@ Index: gcc/ChangeLog * lto-streamer-in.c (lto_data_in_create): Adjust for streamer_tree_cache_create prototype change. -@@ -381,24 +572,6 @@ +@@ -381,24 +603,6 @@ (Weffc++): Remove Scott's numbering, merge lists and reference Wnon-virtual-dtor. @@ -655,7 +1349,7 @@ Index: gcc/ChangeLog 2014-04-03 Nick Clifton <nickc@redhat.com> * config/rl78/rl78-expand.md (movqi): Handle (SUBREG (SYMBOL_REF)) -@@ -414,8 +587,8 @@ +@@ -414,8 +618,8 @@ 2014-04-02 Jan Hubicka <hubicka@ucw.cz> PR ipa/60659 @@ -666,7 +1360,7 @@ Index: gcc/ChangeLog (possible_polymorphic_call_targets): For inconsistent contexts return empty complete list. -@@ -519,8 +692,7 @@ +@@ -519,8 +723,7 @@ 2014-04-01 Richard Biener <rguenther@suse.de> @@ -1074,6 +1768,32 @@ Index: gcc/testsuite/gcc.dg/lto/pr60720_1.c +++ b/src/gcc/testsuite/gcc.dg/lto/pr60720_1.c (.../branches/gcc-4_9-branch) @@ -0,0 +1 @@ +int x; +Index: gcc/testsuite/gcc.dg/lto/pr60911_0.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/lto/pr60911_0.c (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/testsuite/gcc.dg/lto/pr60911_0.c (.../branches/gcc-4_9-branch) +@@ -0,0 +1,21 @@ ++// { dg-lto-do run } ++// { dg-lto-options { { -O2 -flto -fipa-pta } } } ++ ++int __attribute__ ((__noinline__)) f (unsigned *p, int *x) ++{ ++ int y = *p++ & 0xfff; ++ *x++ = y; ++ *x = *p; ++ return y; ++} ++ ++int ++main () ++{ ++ unsigned u[2] = { 0x3aad, 0x5ad1 }; ++ int x[2] = { 17689, 23456 }; ++ ++ if (f (u, x) != 0xaad || x[0] != 0xaad || x[1] != 0x5ad1) ++ __builtin_abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.dg/torture/pr60891.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/torture/pr60891.c (.../tags/gcc_4_9_0_release) @@ -1342,7 +2062,22 @@ Index: gcc/testsuite/ChangeLog =================================================================== --- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_4_9_0_release) +++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-4_9-branch) -@@ -1,3 +1,136 @@ +@@ -1,3 +1,151 @@ ++2014-04-25 Richard Biener <rguenther@suse.de> ++ ++ PR ipa/60912 ++ * g++.dg/opt/pr60912.C: New testcase. ++ ++2014-04-25 Richard Biener <rguenther@suse.de> ++ ++ PR ipa/60911 ++ * gcc.dg/lto/pr60911_0.c: New testcase. ++ ++2014-04-24 Jakub Jelinek <jakub@redhat.com> ++ ++ * c-c++-common/gomp/atomic-16.c: Remove all dg-error directives. ++ Replace load with read and store with write. ++ +2014-04-23 Uros Bizjak <ubizjak@gmail.com> + + Backport from mainline @@ -1479,7 +2214,7 @@ Index: gcc/testsuite/ChangeLog 2014-04-22 Release Manager * GCC 4.9.0 released. -@@ -51,7 +184,7 @@ +@@ -51,7 +199,7 @@ 2014-04-12 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/60810 @@ -1488,7 +2223,7 @@ Index: gcc/testsuite/ChangeLog 2014-04-11 Steve Ellcey <sellcey@mips.com> Jakub Jelinek <jakub@redhat.com> -@@ -135,8 +268,7 @@ +@@ -135,8 +283,7 @@ 2014-04-08 Jason Merrill <jason@redhat.com> @@ -1498,7 +2233,7 @@ Index: gcc/testsuite/ChangeLog 2014-04-08 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> -@@ -256,10 +388,10 @@ +@@ -256,10 +403,10 @@ 2014-04-04 Martin Jambor <mjambor@suse.cz> PR ipa/60640 @@ -1513,7 +2248,7 @@ Index: gcc/testsuite/ChangeLog 2014-04-04 Jeff Law <law@redhat.com> -@@ -371,7 +503,7 @@ +@@ -371,7 +518,7 @@ 2014-04-01 Fabien ChĂȘne <fabien@gcc.gnu.org> @@ -1522,7 +2257,7 @@ Index: gcc/testsuite/ChangeLog * g++.dg/init/ctor4-1.C: New. * g++.dg/cpp0x/defaulted2.C: Adjust. -@@ -459,8 +591,8 @@ +@@ -459,8 +606,8 @@ 2014-03-27 Jeff Law <law@redhat.com> @@ -1533,7 +2268,7 @@ Index: gcc/testsuite/ChangeLog 2014-03-28 Adam Butcher <adam@jessamine.co.uk> -@@ -493,14 +625,13 @@ +@@ -493,14 +640,13 @@ 2014-03-28 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> @@ -1551,7 +2286,7 @@ Index: gcc/testsuite/ChangeLog of second source operand. * gcc.target/i386/avx512f-vshuff64x2-2.c: Ditto. * gcc.target/i386/avx512f-vshufi32x4-2.c: Ditto. -@@ -635,8 +766,8 @@ +@@ -635,8 +781,8 @@ 2014-03-24 Marek Polacek <polacek@redhat.com> @@ -1562,7 +2297,7 @@ Index: gcc/testsuite/ChangeLog * c-c++-common/ubsan/overflow-1.c: Check for unwanted output. * c-c++-common/ubsan/overflow-add-1.c: Likewise. * c-c++-common/ubsan/overflow-mul-1.c: Likewise. -@@ -721,8 +852,7 @@ +@@ -721,8 +867,7 @@ 2014-03-21 Tobias Burnus <burnus@net-b.de> PR fortran/60599 @@ -1634,6 +2369,29 @@ Index: gcc/testsuite/g++.dg/opt/pr60849.C + if (xx(a)) + g++; +} +Index: gcc/testsuite/g++.dg/opt/pr60912.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/opt/pr60912.C (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/testsuite/g++.dg/opt/pr60912.C (.../branches/gcc-4_9-branch) +@@ -0,0 +1,18 @@ ++// { dg-do run } ++// { dg-options "-O -fno-inline -fipa-pta" } ++ ++struct IFoo ++{ ++ virtual void Foo () = 0; ++}; ++ ++struct Bar:IFoo ++{ ++ void Foo () {} ++}; ++ ++int main () ++{ ++ (new Bar ())->Foo (); ++ return 0; ++} Index: gcc/testsuite/g++.dg/torture/pr60895.C =================================================================== --- a/src/gcc/testsuite/g++.dg/torture/pr60895.C (.../tags/gcc_4_9_0_release) @@ -1671,6 +2429,59 @@ Index: gcc/testsuite/g++.dg/torture/pr60895.C +{ + J (); +} +Index: gcc/testsuite/c-c++-common/gomp/atomic-16.c +=================================================================== +--- a/src/gcc/testsuite/c-c++-common/gomp/atomic-16.c (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/testsuite/c-c++-common/gomp/atomic-16.c (.../branches/gcc-4_9-branch) +@@ -7,28 +7,28 @@ + foo () + { + int v; +- #pragma omp atomic seq_cst load /* { dg-error "expected end of line" } */ +- v = x; /* { dg-error "invalid form" } */ +- #pragma omp atomic seq_cst, load /* { dg-error "expected end of line" } */ +- v = x; /* { dg-error "invalid form" } */ +- #pragma omp atomic seq_cst store /* { dg-error "expected end of line" } */ +- x = v; /* { dg-error "invalid form" } */ +- #pragma omp atomic seq_cst ,store /* { dg-error "expected end of line" } */ +- x = v; /* { dg-error "invalid form" } */ +- #pragma omp atomic seq_cst update /* { dg-error "expected end of line" } */ ++ #pragma omp atomic seq_cst read ++ v = x; ++ #pragma omp atomic seq_cst, read ++ v = x; ++ #pragma omp atomic seq_cst write ++ x = v; ++ #pragma omp atomic seq_cst ,write ++ x = v; ++ #pragma omp atomic seq_cst update + x += v; +- #pragma omp atomic seq_cst , update /* { dg-error "expected end of line" } */ ++ #pragma omp atomic seq_cst , update + x += v; +- #pragma omp atomic seq_cst capture /* { dg-error "expected end of line" } */ +- v = x += 2; /* { dg-error "invalid form" } */ +- #pragma omp atomic seq_cst, capture /* { dg-error "expected end of line" } */ +- v = x += 2; /* { dg-error "invalid form" } */ +- #pragma omp atomic load , seq_cst /* { dg-error "expected end of line" } */ +- v = x; /* { dg-error "invalid form" } */ +- #pragma omp atomic store ,seq_cst /* { dg-error "expected end of line" } */ +- x = v; /* { dg-error "invalid form" } */ +- #pragma omp atomic update, seq_cst /* { dg-error "expected end of line" } */ ++ #pragma omp atomic seq_cst capture ++ v = x += 2; ++ #pragma omp atomic seq_cst, capture ++ v = x += 2; ++ #pragma omp atomic read , seq_cst ++ v = x; ++ #pragma omp atomic write ,seq_cst ++ x = v; ++ #pragma omp atomic update, seq_cst + x += v; +- #pragma omp atomic capture, seq_cst /* { dg-error "expected end of line" } */ ++ #pragma omp atomic capture, seq_cst + v = x += 2; + } Index: gcc/testsuite/c-c++-common/gomp/pr60823-1.c =================================================================== --- a/src/gcc/testsuite/c-c++-common/gomp/pr60823-1.c (.../tags/gcc_4_9_0_release) @@ -1801,7 +2612,13 @@ Index: gcc/cp/ChangeLog =================================================================== --- a/src/gcc/cp/ChangeLog (.../tags/gcc_4_9_0_release) +++ b/src/gcc/cp/ChangeLog (.../branches/gcc-4_9-branch) -@@ -1,3 +1,9 @@ +@@ -1,3 +1,15 @@ ++2014-04-24 Jakub Jelinek <jakub@redhat.com> ++ ++ * parser.c (cp_parser_omp_atomic): Allow seq_cst before ++ atomic-clause, allow comma in between atomic-clause and ++ seq_cst. ++ +2014-04-22 Jakub Jelinek <jakub@redhat.com> + + PR c/59073 @@ -1815,7 +2632,58 @@ Index: gcc/cp/parser.c =================================================================== --- a/src/gcc/cp/parser.c (.../tags/gcc_4_9_0_release) +++ b/src/gcc/cp/parser.c (.../branches/gcc-4_9-branch) -@@ -29825,10 +29825,12 @@ +@@ -28530,6 +28530,20 @@ + tree id = cp_lexer_peek_token (parser->lexer)->u.value; + const char *p = IDENTIFIER_POINTER (id); + ++ if (!strcmp (p, "seq_cst")) ++ { ++ seq_cst = true; ++ cp_lexer_consume_token (parser->lexer); ++ if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA) ++ && cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME) ++ cp_lexer_consume_token (parser->lexer); ++ } ++ } ++ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ++ { ++ tree id = cp_lexer_peek_token (parser->lexer)->u.value; ++ const char *p = IDENTIFIER_POINTER (id); ++ + if (!strcmp (p, "read")) + code = OMP_ATOMIC_READ; + else if (!strcmp (p, "write")) +@@ -28543,16 +28557,22 @@ + if (p) + cp_lexer_consume_token (parser->lexer); + } +- +- if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ++ if (!seq_cst) + { +- tree id = cp_lexer_peek_token (parser->lexer)->u.value; +- const char *p = IDENTIFIER_POINTER (id); ++ if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA) ++ && cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME) ++ cp_lexer_consume_token (parser->lexer); + +- if (!strcmp (p, "seq_cst")) ++ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) + { +- seq_cst = true; +- cp_lexer_consume_token (parser->lexer); ++ tree id = cp_lexer_peek_token (parser->lexer)->u.value; ++ const char *p = IDENTIFIER_POINTER (id); ++ ++ if (!strcmp (p, "seq_cst")) ++ { ++ seq_cst = true; ++ cp_lexer_consume_token (parser->lexer); ++ } + } + } + cp_parser_require_pragma_eol (parser, pragma_tok); +@@ -29825,10 +29845,12 @@ return cp_parser_omp_for (parser, pragma_tok, p_name, mask, cclauses); block = begin_omp_parallel (); save = cp_parser_begin_omp_structured_block (parser); @@ -2324,6 +3192,150 @@ Index: gcc/tree-vect-data-refs.c if (!find_data_references_in_stmt (NULL, stmt, &BB_VINFO_DATAREFS (bb_vinfo))) { +Index: gcc/gimplify.c +=================================================================== +--- a/src/gcc/gimplify.c (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/gimplify.c (.../branches/gcc-4_9-branch) +@@ -5793,7 +5793,7 @@ + to the contrary in the innermost scope, generate an error. */ + + static bool +-omp_is_private (struct gimplify_omp_ctx *ctx, tree decl, bool simd) ++omp_is_private (struct gimplify_omp_ctx *ctx, tree decl, int simd) + { + splay_tree_node n; + +@@ -5827,13 +5827,13 @@ + else if ((n->value & GOVD_REDUCTION) != 0) + error ("iteration variable %qE should not be reduction", + DECL_NAME (decl)); +- else if (simd && (n->value & GOVD_LASTPRIVATE) != 0) ++ else if (simd == 1 && (n->value & GOVD_LASTPRIVATE) != 0) + error ("iteration variable %qE should not be lastprivate", + DECL_NAME (decl)); + else if (simd && (n->value & GOVD_PRIVATE) != 0) + error ("iteration variable %qE should not be private", + DECL_NAME (decl)); +- else if (simd && (n->value & GOVD_LINEAR) != 0) ++ else if (simd == 2 && (n->value & GOVD_LINEAR) != 0) + error ("iteration variable %qE is predetermined linear", + DECL_NAME (decl)); + } +@@ -6599,8 +6599,8 @@ + + orig_for_stmt = for_stmt = *expr_p; + +- simd = TREE_CODE (for_stmt) == OMP_SIMD +- || TREE_CODE (for_stmt) == CILK_SIMD; ++ simd = (TREE_CODE (for_stmt) == OMP_SIMD ++ || TREE_CODE (for_stmt) == CILK_SIMD); + gimplify_scan_omp_clauses (&OMP_FOR_CLAUSES (for_stmt), pre_p, + simd ? ORT_SIMD : ORT_WORKSHARE); + +@@ -6656,6 +6656,7 @@ + + /* Make sure the iteration variable is private. */ + tree c = NULL_TREE; ++ tree c2 = NULL_TREE; + if (orig_for_stmt != for_stmt) + /* Do this only on innermost construct for combined ones. */; + else if (simd) +@@ -6662,7 +6663,9 @@ + { + splay_tree_node n = splay_tree_lookup (gimplify_omp_ctxp->variables, + (splay_tree_key)decl); +- omp_is_private (gimplify_omp_ctxp, decl, simd); ++ omp_is_private (gimplify_omp_ctxp, decl, ++ 1 + (TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) ++ != 1)); + if (n != NULL && (n->value & GOVD_DATA_SHARE_CLASS) != 0) + omp_notice_variable (gimplify_omp_ctxp, decl, true); + else if (TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) == 1) +@@ -6688,13 +6691,14 @@ + : OMP_CLAUSE_PRIVATE); + 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, + (lastprivate ? GOVD_LASTPRIVATE : GOVD_PRIVATE) +- | GOVD_SEEN); ++ | GOVD_EXPLICIT | GOVD_SEEN); + c = NULL_TREE; + } + } +- else if (omp_is_private (gimplify_omp_ctxp, decl, simd)) ++ else if (omp_is_private (gimplify_omp_ctxp, decl, 0)) + omp_notice_variable (gimplify_omp_ctxp, decl, true); + else + omp_add_variable (gimplify_omp_ctxp, decl, GOVD_PRIVATE | GOVD_SEEN); +@@ -6711,7 +6715,25 @@ + + gimplify_seq_add_stmt (&for_body, gimple_build_assign (decl, var)); + +- omp_add_variable (gimplify_omp_ctxp, var, GOVD_PRIVATE | GOVD_SEEN); ++ if (simd && TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) == 1) ++ { ++ c2 = build_omp_clause (input_location, OMP_CLAUSE_LINEAR); ++ OMP_CLAUSE_LINEAR_NO_COPYIN (c2) = 1; ++ OMP_CLAUSE_LINEAR_NO_COPYOUT (c2) = 1; ++ OMP_CLAUSE_DECL (c2) = var; ++ OMP_CLAUSE_CHAIN (c2) = OMP_FOR_CLAUSES (for_stmt); ++ OMP_FOR_CLAUSES (for_stmt) = c2; ++ omp_add_variable (gimplify_omp_ctxp, var, ++ GOVD_LINEAR | GOVD_EXPLICIT | GOVD_SEEN); ++ if (c == NULL_TREE) ++ { ++ c = c2; ++ c2 = NULL_TREE; ++ } ++ } ++ else ++ omp_add_variable (gimplify_omp_ctxp, var, ++ GOVD_PRIVATE | GOVD_SEEN); + } + else + var = decl; +@@ -6814,13 +6836,22 @@ + gcc_unreachable (); + } + ++ if (c2) ++ { ++ gcc_assert (c); ++ OMP_CLAUSE_LINEAR_STEP (c2) = OMP_CLAUSE_LINEAR_STEP (c); ++ } ++ + if ((var != decl || TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) > 1) + && orig_for_stmt == for_stmt) + { + for (c = OMP_FOR_CLAUSES (for_stmt); c ; c = OMP_CLAUSE_CHAIN (c)) +- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE +- && OMP_CLAUSE_DECL (c) == decl +- && OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c) == NULL) ++ if (((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE ++ && OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c) == NULL) ++ || (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR ++ && !OMP_CLAUSE_LINEAR_NO_COPYOUT (c) ++ && OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c) == NULL)) ++ && OMP_CLAUSE_DECL (c) == decl) + { + t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i); + gcc_assert (TREE_CODE (t) == MODIFY_EXPR); +@@ -6832,8 +6863,12 @@ + gcc_assert (TREE_OPERAND (t, 0) == var); + t = build2 (TREE_CODE (t), TREE_TYPE (decl), decl, + TREE_OPERAND (t, 1)); +- gimplify_assign (decl, t, +- &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)); ++ gimple_seq *seq; ++ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE) ++ seq = &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c); ++ else ++ seq = &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c); ++ gimplify_assign (decl, t, seq); + } + } + } Index: gcc/graphite-scop-detection.c =================================================================== --- a/src/gcc/graphite-scop-detection.c (.../tags/gcc_4_9_0_release) @@ -2412,6 +3424,60 @@ Index: gcc/cfgexpand.c var_end_seq = asan_emit_stack_protection (virtual_stack_vars_rtx, +Index: gcc/tree-nested.c +=================================================================== +--- a/src/gcc/tree-nested.c (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/tree-nested.c (.../branches/gcc-4_9-branch) +@@ -1082,6 +1082,11 @@ + need_stmts = true; + goto do_decl_clause; + ++ case OMP_CLAUSE_LINEAR: ++ if (OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause)) ++ need_stmts = true; ++ goto do_decl_clause; ++ + case OMP_CLAUSE_PRIVATE: + case OMP_CLAUSE_FIRSTPRIVATE: + case OMP_CLAUSE_COPYPRIVATE: +@@ -1157,6 +1162,12 @@ + &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause)); + break; + ++ case OMP_CLAUSE_LINEAR: ++ walk_body (convert_nonlocal_reference_stmt, ++ convert_nonlocal_reference_op, info, ++ &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause)); ++ break; ++ + default: + break; + } +@@ -1605,6 +1616,11 @@ + need_stmts = true; + goto do_decl_clause; + ++ case OMP_CLAUSE_LINEAR: ++ if (OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause)) ++ need_stmts = true; ++ goto do_decl_clause; ++ + case OMP_CLAUSE_PRIVATE: + case OMP_CLAUSE_FIRSTPRIVATE: + case OMP_CLAUSE_COPYPRIVATE: +@@ -1685,6 +1701,12 @@ + &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause)); + break; + ++ case OMP_CLAUSE_LINEAR: ++ walk_body (convert_local_reference_stmt, ++ convert_local_reference_op, info, ++ &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause)); ++ break; ++ + default: + break; + } Index: gcc/tree-inline.c =================================================================== --- a/src/gcc/tree-inline.c (.../tags/gcc_4_9_0_release) @@ -2438,6 +3504,142 @@ Index: gcc/config.gcc tmake_file="${tmake_file} msp430/t-msp430" ;; nds32le-*-*) +Index: gcc/tree-ssa-structalias.c +=================================================================== +--- a/src/gcc/tree-ssa-structalias.c (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/tree-ssa-structalias.c (.../branches/gcc-4_9-branch) +@@ -7264,10 +7264,7 @@ + tree ptr; + struct function *fn; + unsigned i; +- varinfo_t fi; + basic_block bb; +- struct pt_solution uses, clobbers; +- struct cgraph_edge *e; + + /* Nodes without a body are not interesting. */ + if (!cgraph_function_with_gimple_body_p (node) || node->clone_of) +@@ -7283,21 +7280,6 @@ + find_what_p_points_to (ptr); + } + +- /* Compute the call-use and call-clobber sets for all direct calls. */ +- fi = lookup_vi_for_tree (node->decl); +- gcc_assert (fi->is_fn_info); +- clobbers +- = find_what_var_points_to (first_vi_for_offset (fi, fi_clobbers)); +- uses = find_what_var_points_to (first_vi_for_offset (fi, fi_uses)); +- for (e = node->callers; e; e = e->next_caller) +- { +- if (!e->call_stmt) +- continue; +- +- *gimple_call_clobber_set (e->call_stmt) = clobbers; +- *gimple_call_use_set (e->call_stmt) = uses; +- } +- + /* Compute the call-use and call-clobber sets for indirect calls + and calls to external functions. */ + FOR_EACH_BB_FN (bb, fn) +@@ -7308,18 +7290,28 @@ + { + gimple stmt = gsi_stmt (gsi); + struct pt_solution *pt; +- varinfo_t vi; ++ varinfo_t vi, fi; + tree decl; + + if (!is_gimple_call (stmt)) + continue; + +- /* Handle direct calls to external functions. */ ++ /* Handle direct calls to functions with body. */ + decl = gimple_call_fndecl (stmt); + if (decl +- && (!(fi = lookup_vi_for_tree (decl)) +- || !fi->is_fn_info)) ++ && (fi = lookup_vi_for_tree (decl)) ++ && fi->is_fn_info) + { ++ *gimple_call_clobber_set (stmt) ++ = find_what_var_points_to ++ (first_vi_for_offset (fi, fi_clobbers)); ++ *gimple_call_use_set (stmt) ++ = find_what_var_points_to ++ (first_vi_for_offset (fi, fi_uses)); ++ } ++ /* Handle direct calls to external functions. */ ++ else if (decl) ++ { + pt = gimple_call_use_set (stmt); + if (gimple_call_flags (stmt) & ECF_CONST) + memset (pt, 0, sizeof (struct pt_solution)); +@@ -7362,10 +7354,9 @@ + pt->nonlocal = 1; + } + } +- + /* Handle indirect calls. */ +- if (!decl +- && (fi = get_fi_for_callee (stmt))) ++ else if (!decl ++ && (fi = get_fi_for_callee (stmt))) + { + /* We need to accumulate all clobbers/uses of all possible + callees. */ +Index: gcc/passes.c +=================================================================== +--- a/src/gcc/passes.c (.../tags/gcc_4_9_0_release) ++++ b/src/gcc/passes.c (.../branches/gcc-4_9-branch) +@@ -2109,20 +2109,6 @@ + } + } + +-/* Callback for do_per_function to apply all IPA transforms. */ +- +-static void +-apply_ipa_transforms (void *data) +-{ +- struct cgraph_node *node = cgraph_get_node (current_function_decl); +- if (!node->global.inlined_to && node->ipa_transforms_to_apply.exists ()) +- { +- *(bool *)data = true; +- execute_all_ipa_transforms (); +- rebuild_cgraph_edges (); +- } +-} +- + /* Check if PASS is explicitly disabled or enabled and return + the gate status. FUNC is the function to be processed, and + GATE_STATUS is the gate status determined by pass manager by +@@ -2194,8 +2180,26 @@ + Apply all trnasforms first. */ + if (pass->type == SIMPLE_IPA_PASS) + { ++ struct cgraph_node *node; + bool applied = false; +- do_per_function (apply_ipa_transforms, (void *)&applied); ++ FOR_EACH_DEFINED_FUNCTION (node) ++ if (node->analyzed ++ && cgraph_function_with_gimple_body_p (node) ++ && (!node->clone_of || node->decl != node->clone_of->decl)) ++ { ++ if (!node->global.inlined_to ++ && node->ipa_transforms_to_apply.exists ()) ++ { ++ cgraph_get_body (node); ++ push_cfun (DECL_STRUCT_FUNCTION (node->decl)); ++ execute_all_ipa_transforms (); ++ rebuild_cgraph_edges (); ++ free_dominance_info (CDI_DOMINATORS); ++ free_dominance_info (CDI_POST_DOMINATORS); ++ pop_cfun (); ++ applied = true; ++ } ++ } + if (applied) + symtab_remove_unreachable_nodes (true, dump_file); + /* Restore current_pass. */ Index: gcc/tree-ssa-reassoc.c =================================================================== --- a/src/gcc/tree-ssa-reassoc.c (.../tags/gcc_4_9_0_release) @@ -3159,3 +4361,35 @@ Index: gcc/tree-vect-slp.c { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, +Index: libgo/runtime/mheap.c +=================================================================== +--- a/src/libgo/runtime/mheap.c (.../tags/gcc_4_9_0_release) ++++ b/src/libgo/runtime/mheap.c (.../branches/gcc-4_9-branch) +@@ -387,7 +387,7 @@ + static uintptr + scavengelist(MSpan *list, uint64 now, uint64 limit) + { +- uintptr released, sumreleased; ++ uintptr released, sumreleased, start, end, pagesize; + MSpan *s; + + if(runtime_MSpanList_IsEmpty(list)) +@@ -400,7 +400,17 @@ + mstats.heap_released += released; + sumreleased += released; + s->npreleased = s->npages; +- runtime_SysUnused((void*)(s->start << PageShift), s->npages << PageShift); ++ ++ start = s->start << PageShift; ++ end = start + (s->npages << PageShift); ++ ++ // Round start up and end down to ensure we ++ // are acting on entire pages. ++ pagesize = getpagesize(); ++ start = ROUND(start, pagesize); ++ end &= ~(pagesize - 1); ++ if(end > start) ++ runtime_SysUnused((void*)start, end - start); + } + } + return sumreleased; |