Index: configure =================================================================== --- configure (.../tags/gcc_4_5_0_release) (wersja 159624) +++ configure (.../branches/gcc-4_5-branch) (wersja 159624) @@ -7610,7 +7610,7 @@ mv conftest.o conftest.o.g0 && ${CC} -c -g conftest.c && mv conftest.o conftest.o.g && - ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g; then + ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then : else BUILD_CONFIG= Index: libgcc/config.host =================================================================== --- libgcc/config.host (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgcc/config.host (.../branches/gcc-4_5-branch) (wersja 159624) @@ -600,6 +600,7 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ i[34567]86-*-linux* | x86_64-*-linux* | \ + i[34567]86-*-gnu* | \ i[34567]86-*-solaris2* | \ i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*) if test "${host_address}" = 32; then Index: libgcc/config/i386/32/sfp-machine.h =================================================================== --- libgcc/config/i386/32/sfp-machine.h (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgcc/config/i386/32/sfp-machine.h (.../branches/gcc-4_5-branch) (wersja 159624) @@ -142,8 +142,8 @@ if (_fex & FP_EX_DIVZERO) \ { \ float f = 1.0, g = 0.0; \ - __asm__ __volatile__ ("fdivp" : "=t" (f) \ - : "0" (f), "u" (g) \ + __asm__ __volatile__ ("fdivp {%0, %y1|%y1, %0}" \ + : "+t" (f) : "u" (g) \ : "st(1)"); \ __asm__ __volatile__ ("fwait"); \ } \ Index: libgcc/ChangeLog =================================================================== --- libgcc/ChangeLog (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgcc/ChangeLog (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1,3 +1,15 @@ +2010-05-19 Rainer Orth + + * config/i386/32/sfp-machine.h (FP_HANDLE_EXCEPTIONS): Support Sun + assembler syntax. + +2010-04-15 Thomas Schwinge + + Backport from mainline: + 2010-04-15 Thomas Schwinge + + * config.host : Handle softfp as for Linux. + 2010-04-14 Release Manager * GCC 4.5.0 released. Index: libgomp/sections.c =================================================================== --- libgomp/sections.c (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgomp/sections.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of the GNU OpenMP Library (libgomp). @@ -34,9 +34,25 @@ { ws->sched = GFS_DYNAMIC; ws->chunk_size = 1; - ws->end = count + 1; + ws->end = count + 1L; ws->incr = 1; ws->next = 1; +#ifdef HAVE_SYNC_BUILTINS + /* Prepare things to make each iteration faster. */ + if (sizeof (long) > sizeof (unsigned)) + ws->mode = 1; + else + { + struct gomp_thread *thr = gomp_thread (); + struct gomp_team *team = thr->ts.team; + long nthreads = team ? team->nthreads : 1; + + ws->mode = ((nthreads | ws->end) + < 1UL << (sizeof (long) * __CHAR_BIT__ / 2 - 1)); + } +#else + ws->mode = 0; +#endif } /* This routine is called when first encountering a sections construct Index: libgomp/ChangeLog =================================================================== --- libgomp/ChangeLog (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgomp/ChangeLog (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1,3 +1,24 @@ +2010-04-26 Jakub Jelinek + + PR c/43893 + * testsuite/libgomp.c/pr43893.c: New test. + * testsuite/libgomp.c++/pr43893.C: New test. + +2010-04-21 Jakub Jelinek + + PR middle-end/43570 + * testsuite/libgomp.fortran/vla8.f90: New test. + + PR libgomp/43706 + * config/linux/affinity.c (gomp_init_affinity): Decrease + gomp_available_cpus if affinity mask confines the process to fewer + CPUs. + * config/linux/proc.c (get_num_procs): If gomp_cpu_affinity is + non-NULL, just return gomp_available_cpus. + + PR libgomp/43569 + * sections.c (gomp_sections_init): Initialize ws->mode. + 2010-04-14 Release Manager * GCC 4.5.0 released. Index: libgomp/testsuite/libgomp.c++/pr43893.C =================================================================== --- libgomp/testsuite/libgomp.c++/pr43893.C (.../tags/gcc_4_5_0_release) (wersja 0) +++ libgomp/testsuite/libgomp.c++/pr43893.C (.../branches/gcc-4_5-branch) (wersja 159624) @@ -0,0 +1,125 @@ +// PR c/43893 +// { dg-do run } + +extern "C" void abort (); + +template +void +f1 () +{ + int c; + T i; + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = M; i < N; i++) + c++; + if (c != 1) + abort (); +} + +template +void +f2 () +{ + int c; + T i; + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = M; i <= N; i++) + c++; + if (c != 1) + abort (); +} + +template +void +f3 () +{ + int c; + T i; + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = M; i > N; i--) + c++; + if (c != 1) + abort (); +} + +template +void +f4 () +{ + int c; + T i; + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = M; i >= N; i--) + c++; + if (c != 1) + abort (); +} + +int +main () +{ + int c; + unsigned int i; + int j; + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 0; i < 1; i++) + c++; + if (c != 1) + abort (); + f1 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 0; i <= 0; i++) + c++; + if (c != 1) + abort (); + f2 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = - __INT_MAX__ - 1; j < - __INT_MAX__; j++) + c++; + if (c != 1) + abort (); + f1 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = - __INT_MAX__ - 1; j <= - __INT_MAX__ - 1; j++) + c++; + if (c != 1) + abort (); + f2 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 2U * __INT_MAX__ + 1; i > 2U * __INT_MAX__; i--) + c++; + if (c != 1) + abort (); + f3 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 2U * __INT_MAX__ + 1; i >= 2U * __INT_MAX__ + 1; i--) + c++; + if (c != 1) + abort (); + f4 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = __INT_MAX__; j > __INT_MAX__ - 1; j--) + c++; + if (c != 1) + abort (); + f3 (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = __INT_MAX__; j >= __INT_MAX__; j--) + c++; + if (c != 1) + abort (); + f4 (); + return 0; +} Index: libgomp/testsuite/libgomp.fortran/vla8.f90 =================================================================== --- libgomp/testsuite/libgomp.fortran/vla8.f90 (.../tags/gcc_4_5_0_release) (wersja 0) +++ libgomp/testsuite/libgomp.fortran/vla8.f90 (.../branches/gcc-4_5-branch) (wersja 159624) @@ -0,0 +1,254 @@ +! { dg-do run } + + call test +contains + subroutine check (x, y, l) + integer :: x, y + logical :: l + l = l .or. x .ne. y + end subroutine check + + subroutine foo (c, d, e, f, g, h, i, j, k, n) + use omp_lib + integer :: n + character (len = *) :: c + character (len = n) :: d + integer, dimension (2, 3:5, n) :: e + integer, dimension (2, 3:n, n) :: f + character (len = *), dimension (5, 3:n) :: g + character (len = n), dimension (5, 3:n) :: h + real, dimension (:, :, :) :: i + double precision, dimension (3:, 5:, 7:) :: j + integer, dimension (:, :, :) :: k + logical :: l + integer :: p, q, r + character (len = n) :: s + integer, dimension (2, 3:5, n) :: t + integer, dimension (2, 3:n, n) :: u + character (len = n), dimension (5, 3:n) :: v + character (len = 2 * n + 24) :: w + integer :: x, z + character (len = 1) :: y + l = .false. +!$omp parallel default (none) private (c, d, e, f, g, h, i, j, k) & +!$omp & private (s, t, u, v) reduction (.or.:l) num_threads (6) & +!$omp private (p, q, r, w, x, y) shared (z) + x = omp_get_thread_num () + w = '' + if (x .eq. 0) w = 'thread0thr_number_0THREAD0THR_NUMBER_0' + if (x .eq. 1) w = 'thread1thr_number_1THREAD1THR_NUMBER_1' + if (x .eq. 2) w = 'thread2thr_number_2THREAD2THR_NUMBER_2' + if (x .eq. 3) w = 'thread3thr_number_3THREAD3THR_NUMBER_3' + if (x .eq. 4) w = 'thread4thr_number_4THREAD4THR_NUMBER_4' + if (x .eq. 5) w = 'thread5thr_number_5THREAD5THR_NUMBER_5' + c = w(8:19) + d = w(1:7) + forall (p = 1:2, q = 3:5, r = 1:7) e(p, q, r) = 5 * x + p + q + 2 * r + forall (p = 1:2, q = 3:7, r = 1:7) f(p, q, r) = 25 * x + p + q + 2 * r + forall (p = 1:5, q = 3:7, p + q .le. 8) g(p, q) = w(8:19) + forall (p = 1:5, q = 3:7, p + q .gt. 8) g(p, q) = w(27:38) + forall (p = 1:5, q = 3:7, p + q .le. 8) h(p, q) = w(1:7) + forall (p = 1:5, q = 3:7, p + q .gt. 8) h(p, q) = w(20:26) + forall (p = 3:5, q = 2:6, r = 1:7) i(p - 2, q - 1, r) = (7.5 + x) * p * q * r + forall (p = 3:5, q = 2:6, r = 1:7) j(p, q + 3, r + 6) = (9.5 + x) * p * q * r + forall (p = 1:5, q = 7:7, r = 4:6) k(p, q - 6, r - 3) = 19 + x + p + q + 3 * r + s = w(20:26) + forall (p = 1:2, q = 3:5, r = 1:7) t(p, q, r) = -10 + x + p - q + 2 * r + forall (p = 1:2, q = 3:7, r = 1:7) u(p, q, r) = 30 - x - p + q - 2 * r + forall (p = 1:5, q = 3:7, p + q .le. 8) v(p, q) = w(1:7) + forall (p = 1:5, q = 3:7, p + q .gt. 8) v(p, q) = w(20:26) +!$omp barrier + y = '' + if (x .eq. 0) y = '0' + if (x .eq. 1) y = '1' + if (x .eq. 2) y = '2' + if (x .eq. 3) y = '3' + if (x .eq. 4) y = '4' + if (x .eq. 5) y = '5' + l = l .or. w(7:7) .ne. y + l = l .or. w(19:19) .ne. y + l = l .or. w(26:26) .ne. y + l = l .or. w(38:38) .ne. y + l = l .or. c .ne. w(8:19) + l = l .or. d .ne. w(1:7) + l = l .or. s .ne. w(20:26) + do 103, p = 1, 2 + do 103, q = 3, 7 + do 103, r = 1, 7 + if (q .lt. 6) l = l .or. e(p, q, r) .ne. 5 * x + p + q + 2 * r + l = l .or. f(p, q, r) .ne. 25 * x + p + q + 2 * r + if (r .lt. 6 .and. q + r .le. 8) l = l .or. g(r, q) .ne. w(8:19) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. g(r, q) .ne. w(27:38) + if (r .lt. 6 .and. q + r .le. 8) l = l .or. h(r, q) .ne. w(1:7) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. h(r, q) .ne. w(20:26) + if (q .lt. 6) l = l .or. t(p, q, r) .ne. -10 + x + p - q + 2 * r + l = l .or. u(p, q, r) .ne. 30 - x - p + q - 2 * r + if (r .lt. 6 .and. q + r .le. 8) l = l .or. v(r, q) .ne. w(1:7) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. v(r, q) .ne. w(20:26) +103 continue + do 104, p = 3, 5 + do 104, q = 2, 6 + do 104, r = 1, 7 + l = l .or. i(p - 2, q - 1, r) .ne. (7.5 + x) * p * q * r + l = l .or. j(p, q + 3, r + 6) .ne. (9.5 + x) * p * q * r +104 continue + do 105, p = 1, 5 + do 105, q = 4, 6 + l = l .or. k(p, 1, q - 3) .ne. 19 + x + p + 7 + 3 * q +105 continue + call check (size (e, 1), 2, l) + call check (size (e, 2), 3, l) + call check (size (e, 3), 7, l) + call check (size (e), 42, l) + call check (size (f, 1), 2, l) + call check (size (f, 2), 5, l) + call check (size (f, 3), 7, l) + call check (size (f), 70, l) + call check (size (g, 1), 5, l) + call check (size (g, 2), 5, l) + call check (size (g), 25, l) + call check (size (h, 1), 5, l) + call check (size (h, 2), 5, l) + call check (size (h), 25, l) + call check (size (i, 1), 3, l) + call check (size (i, 2), 5, l) + call check (size (i, 3), 7, l) + call check (size (i), 105, l) + call check (size (j, 1), 4, l) + call check (size (j, 2), 5, l) + call check (size (j, 3), 7, l) + call check (size (j), 140, l) + call check (size (k, 1), 5, l) + call check (size (k, 2), 1, l) + call check (size (k, 3), 3, l) + call check (size (k), 15, l) +!$omp single + z = omp_get_thread_num () +!$omp end single copyprivate (c, d, e, f, g, h, i, j, k, s, t, u, v) + w = '' + x = z + if (x .eq. 0) w = 'thread0thr_number_0THREAD0THR_NUMBER_0' + if (x .eq. 1) w = 'thread1thr_number_1THREAD1THR_NUMBER_1' + if (x .eq. 2) w = 'thread2thr_number_2THREAD2THR_NUMBER_2' + if (x .eq. 3) w = 'thread3thr_number_3THREAD3THR_NUMBER_3' + if (x .eq. 4) w = 'thread4thr_number_4THREAD4THR_NUMBER_4' + if (x .eq. 5) w = 'thread5thr_number_5THREAD5THR_NUMBER_5' + y = '' + if (x .eq. 0) y = '0' + if (x .eq. 1) y = '1' + if (x .eq. 2) y = '2' + if (x .eq. 3) y = '3' + if (x .eq. 4) y = '4' + if (x .eq. 5) y = '5' + l = l .or. w(7:7) .ne. y + l = l .or. w(19:19) .ne. y + l = l .or. w(26:26) .ne. y + l = l .or. w(38:38) .ne. y + l = l .or. c .ne. w(8:19) + l = l .or. d .ne. w(1:7) + l = l .or. s .ne. w(20:26) + do 113, p = 1, 2 + do 113, q = 3, 7 + do 113, r = 1, 7 + if (q .lt. 6) l = l .or. e(p, q, r) .ne. 5 * x + p + q + 2 * r + l = l .or. f(p, q, r) .ne. 25 * x + p + q + 2 * r + if (r .lt. 6 .and. q + r .le. 8) l = l .or. g(r, q) .ne. w(8:19) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. g(r, q) .ne. w(27:38) + if (r .lt. 6 .and. q + r .le. 8) l = l .or. h(r, q) .ne. w(1:7) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. h(r, q) .ne. w(20:26) + if (q .lt. 6) l = l .or. t(p, q, r) .ne. -10 + x + p - q + 2 * r + l = l .or. u(p, q, r) .ne. 30 - x - p + q - 2 * r + if (r .lt. 6 .and. q + r .le. 8) l = l .or. v(r, q) .ne. w(1:7) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. v(r, q) .ne. w(20:26) +113 continue + do 114, p = 3, 5 + do 114, q = 2, 6 + do 114, r = 1, 7 + l = l .or. i(p - 2, q - 1, r) .ne. (7.5 + x) * p * q * r + l = l .or. j(p, q + 3, r + 6) .ne. (9.5 + x) * p * q * r +114 continue + do 115, p = 1, 5 + do 115, q = 4, 6 + l = l .or. k(p, 1, q - 3) .ne. 19 + x + p + 7 + 3 * q +115 continue + x = omp_get_thread_num () + w = '' + if (x .eq. 0) w = 'thread0thr_number_0THREAD0THR_NUMBER_0' + if (x .eq. 1) w = 'thread1thr_number_1THREAD1THR_NUMBER_1' + if (x .eq. 2) w = 'thread2thr_number_2THREAD2THR_NUMBER_2' + if (x .eq. 3) w = 'thread3thr_number_3THREAD3THR_NUMBER_3' + if (x .eq. 4) w = 'thread4thr_number_4THREAD4THR_NUMBER_4' + if (x .eq. 5) w = 'thread5thr_number_5THREAD5THR_NUMBER_5' + c = w(8:19) + d = w(1:7) + forall (p = 1:2, q = 3:5, r = 1:7) e(p, q, r) = 5 * x + p + q + 2 * r + forall (p = 1:2, q = 3:7, r = 1:7) f(p, q, r) = 25 * x + p + q + 2 * r + forall (p = 1:5, q = 3:7, p + q .le. 8) g(p, q) = w(8:19) + forall (p = 1:5, q = 3:7, p + q .gt. 8) g(p, q) = w(27:38) + forall (p = 1:5, q = 3:7, p + q .le. 8) h(p, q) = w(1:7) + forall (p = 1:5, q = 3:7, p + q .gt. 8) h(p, q) = w(20:26) + forall (p = 3:5, q = 2:6, r = 1:7) i(p - 2, q - 1, r) = (7.5 + x) * p * q * r + forall (p = 3:5, q = 2:6, r = 1:7) j(p, q + 3, r + 6) = (9.5 + x) * p * q * r + forall (p = 1:5, q = 7:7, r = 4:6) k(p, q - 6, r - 3) = 19 + x + p + q + 3 * r + s = w(20:26) + forall (p = 1:2, q = 3:5, r = 1:7) t(p, q, r) = -10 + x + p - q + 2 * r + forall (p = 1:2, q = 3:7, r = 1:7) u(p, q, r) = 30 - x - p + q - 2 * r + forall (p = 1:5, q = 3:7, p + q .le. 8) v(p, q) = w(1:7) + forall (p = 1:5, q = 3:7, p + q .gt. 8) v(p, q) = w(20:26) +!$omp barrier + y = '' + if (x .eq. 0) y = '0' + if (x .eq. 1) y = '1' + if (x .eq. 2) y = '2' + if (x .eq. 3) y = '3' + if (x .eq. 4) y = '4' + if (x .eq. 5) y = '5' + l = l .or. w(7:7) .ne. y + l = l .or. w(19:19) .ne. y + l = l .or. w(26:26) .ne. y + l = l .or. w(38:38) .ne. y + l = l .or. c .ne. w(8:19) + l = l .or. d .ne. w(1:7) + l = l .or. s .ne. w(20:26) + do 123, p = 1, 2 + do 123, q = 3, 7 + do 123, r = 1, 7 + if (q .lt. 6) l = l .or. e(p, q, r) .ne. 5 * x + p + q + 2 * r + l = l .or. f(p, q, r) .ne. 25 * x + p + q + 2 * r + if (r .lt. 6 .and. q + r .le. 8) l = l .or. g(r, q) .ne. w(8:19) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. g(r, q) .ne. w(27:38) + if (r .lt. 6 .and. q + r .le. 8) l = l .or. h(r, q) .ne. w(1:7) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. h(r, q) .ne. w(20:26) + if (q .lt. 6) l = l .or. t(p, q, r) .ne. -10 + x + p - q + 2 * r + l = l .or. u(p, q, r) .ne. 30 - x - p + q - 2 * r + if (r .lt. 6 .and. q + r .le. 8) l = l .or. v(r, q) .ne. w(1:7) + if (r .lt. 6 .and. q + r .gt. 8) l = l .or. v(r, q) .ne. w(20:26) +123 continue + do 124, p = 3, 5 + do 124, q = 2, 6 + do 124, r = 1, 7 + l = l .or. i(p - 2, q - 1, r) .ne. (7.5 + x) * p * q * r + l = l .or. j(p, q + 3, r + 6) .ne. (9.5 + x) * p * q * r +124 continue + do 125, p = 1, 5 + do 125, q = 4, 6 + l = l .or. k(p, 1, q - 3) .ne. 19 + x + p + 7 + 3 * q +125 continue +!$omp end parallel + if (l) call abort + end subroutine foo + + subroutine test + character (len = 12) :: c + character (len = 7) :: d + integer, dimension (2, 3:5, 7) :: e + integer, dimension (2, 3:7, 7) :: f + character (len = 12), dimension (5, 3:7) :: g + character (len = 7), dimension (5, 3:7) :: h + real, dimension (3:5, 2:6, 1:7) :: i + double precision, dimension (3:6, 2:6, 1:7) :: j + integer, dimension (1:5, 7:7, 4:6) :: k + integer :: p, q, r + call foo (c, d, e, f, g, h, i, j, k, 7) + end subroutine test +end Index: libgomp/testsuite/libgomp.c/pr43893.c =================================================================== --- libgomp/testsuite/libgomp.c/pr43893.c (.../tags/gcc_4_5_0_release) (wersja 0) +++ libgomp/testsuite/libgomp.c/pr43893.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -0,0 +1,61 @@ +/* PR c/43893 */ +/* { dg-do run } */ + +extern void abort (void); + +int +main () +{ + int c; + unsigned int i; + int j; + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 0; i < 1; i++) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 0; i <= 0; i++) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = - __INT_MAX__ - 1; j < - __INT_MAX__; j++) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = - __INT_MAX__ - 1; j <= - __INT_MAX__ - 1; j++) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 2U * __INT_MAX__ + 1; i > 2U * __INT_MAX__; i--) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (i = 2U * __INT_MAX__ + 1; i >= 2U * __INT_MAX__ + 1; i--) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = __INT_MAX__; j > __INT_MAX__ - 1; j--) + c++; + if (c != 1) + abort (); + c = 0; +#pragma omp parallel for reduction(+:c) + for (j = __INT_MAX__; j >= __INT_MAX__; j--) + c++; + if (c != 1) + abort (); + return 0; +} Index: libgomp/config/linux/proc.c =================================================================== --- libgomp/config/linux/proc.c (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgomp/config/linux/proc.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1,4 +1,5 @@ -/* Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. Contributed by Jakub Jelinek . This file is part of the GNU OpenMP Library (libgomp). @@ -104,26 +105,13 @@ } else { - size_t idx; - static int affinity_cpus; - /* We can't use pthread_getaffinity_np in this case (we have changed it ourselves, it binds to just one CPU). Count instead the number of different CPUs we are - using. */ - CPU_ZERO (&cpuset); - if (affinity_cpus == 0) - { - int cpus = 0; - for (idx = 0; idx < gomp_cpu_affinity_len; idx++) - if (! CPU_ISSET (gomp_cpu_affinity[idx], &cpuset)) - { - cpus++; - CPU_SET (gomp_cpu_affinity[idx], &cpuset); - } - affinity_cpus = cpus; - } - return affinity_cpus; + using. gomp_init_affinity updated gomp_available_cpus to + the number of CPUs in the GOMP_AFFINITY mask that we are + allowed to use though. */ + return gomp_available_cpus; } #endif #ifdef _SC_NPROCESSORS_ONLN Index: libgomp/config/linux/affinity.c =================================================================== --- libgomp/config/linux/affinity.c (.../tags/gcc_4_5_0_release) (wersja 159624) +++ libgomp/config/linux/affinity.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1,4 +1,4 @@ -/* Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Jakub Jelinek . This file is part of the GNU OpenMP Library (libgomp). @@ -39,8 +39,9 @@ void gomp_init_affinity (void) { - cpu_set_t cpuset; + cpu_set_t cpuset, cpusetnew; size_t idx, widx; + unsigned long cpus = 0; if (pthread_getaffinity_np (pthread_self (), sizeof (cpuset), &cpuset)) { @@ -51,10 +52,18 @@ return; } + CPU_ZERO (&cpusetnew); for (widx = idx = 0; idx < gomp_cpu_affinity_len; idx++) if (gomp_cpu_affinity[idx] < CPU_SETSIZE && CPU_ISSET (gomp_cpu_affinity[idx], &cpuset)) - gomp_cpu_affinity[widx++] = gomp_cpu_affinity[idx]; + { + if (! CPU_ISSET (gomp_cpu_affinity[idx], &cpusetnew)) + { + cpus++; + CPU_SET (gomp_cpu_affinity[idx], &cpusetnew); + } + gomp_cpu_affinity[widx++] = gomp_cpu_affinity[idx]; + } if (widx == 0) { @@ -66,6 +75,8 @@ } gomp_cpu_affinity_len = widx; + if (cpus < gomp_available_cpus) + gomp_available_cpus = cpus; CPU_ZERO (&cpuset); CPU_SET (gomp_cpu_affinity[0], &cpuset); pthread_setaffinity_np (pthread_self (), sizeof (cpuset), &cpuset); Index: gcc/tree-vrp.c =================================================================== --- gcc/tree-vrp.c (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/tree-vrp.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -764,7 +764,28 @@ && integer_zerop (vr->max); } +/* Return true if max and min of VR are INTEGER_CST. It's not necessary + a singleton. */ +static inline bool +range_int_cst_p (value_range_t *vr) +{ + return (vr->type == VR_RANGE + && TREE_CODE (vr->max) == INTEGER_CST + && TREE_CODE (vr->min) == INTEGER_CST + && !TREE_OVERFLOW (vr->max) + && !TREE_OVERFLOW (vr->min)); +} + +/* Return true if VR is a INTEGER_CST singleton. */ + +static inline bool +range_int_cst_singleton_p (value_range_t *vr) +{ + return (range_int_cst_p (vr) + && tree_int_cst_equal (vr->min, vr->max)); +} + /* Return true if value range VR involves at least one symbol. */ static inline bool @@ -2498,19 +2519,20 @@ } else if (code == BIT_AND_EXPR) { - if (vr0.type == VR_RANGE - && vr0.min == vr0.max - && TREE_CODE (vr0.max) == INTEGER_CST - && !TREE_OVERFLOW (vr0.max) - && tree_int_cst_sgn (vr0.max) >= 0) + bool vr0_int_cst_singleton_p, vr1_int_cst_singleton_p; + + vr0_int_cst_singleton_p = range_int_cst_singleton_p (&vr0); + vr1_int_cst_singleton_p = range_int_cst_singleton_p (&vr1); + + if (vr0_int_cst_singleton_p && vr1_int_cst_singleton_p) + min = max = int_const_binop (code, vr0.max, vr1.max, 0); + else if (vr0_int_cst_singleton_p + && tree_int_cst_sgn (vr0.max) >= 0) { min = build_int_cst (expr_type, 0); max = vr0.max; } - else if (vr1.type == VR_RANGE - && vr1.min == vr1.max - && TREE_CODE (vr1.max) == INTEGER_CST - && !TREE_OVERFLOW (vr1.max) + else if (vr1_int_cst_singleton_p && tree_int_cst_sgn (vr1.max) >= 0) { type = VR_RANGE; @@ -2525,12 +2547,8 @@ } else if (code == BIT_IOR_EXPR) { - if (vr0.type == VR_RANGE - && vr1.type == VR_RANGE - && TREE_CODE (vr0.min) == INTEGER_CST - && TREE_CODE (vr1.min) == INTEGER_CST - && TREE_CODE (vr0.max) == INTEGER_CST - && TREE_CODE (vr1.max) == INTEGER_CST + if (range_int_cst_p (&vr0) + && range_int_cst_p (&vr1) && tree_int_cst_sgn (vr0.min) >= 0 && tree_int_cst_sgn (vr1.min) >= 0) { @@ -2715,8 +2733,16 @@ || vr0.type == VR_ANTI_RANGE) && TREE_CODE (vr0.min) == INTEGER_CST && TREE_CODE (vr0.max) == INTEGER_CST - && !is_overflow_infinity (vr0.min) - && !is_overflow_infinity (vr0.max) + && (!is_overflow_infinity (vr0.min) + || (vr0.type == VR_RANGE + && TYPE_PRECISION (outer_type) > TYPE_PRECISION (inner_type) + && needs_overflow_infinity (outer_type) + && supports_overflow_infinity (outer_type))) + && (!is_overflow_infinity (vr0.max) + || (vr0.type == VR_RANGE + && TYPE_PRECISION (outer_type) > TYPE_PRECISION (inner_type) + && needs_overflow_infinity (outer_type) + && supports_overflow_infinity (outer_type))) && (TYPE_PRECISION (outer_type) >= TYPE_PRECISION (inner_type) || (vr0.type == VR_RANGE && integer_zerop (int_const_binop (RSHIFT_EXPR, @@ -2730,6 +2756,10 @@ new_max = force_fit_type_double (outer_type, TREE_INT_CST_LOW (vr0.max), TREE_INT_CST_HIGH (vr0.max), 0, 0); + if (is_overflow_infinity (vr0.min)) + new_min = negative_overflow_infinity (outer_type); + if (is_overflow_infinity (vr0.max)) + new_max = positive_overflow_infinity (outer_type); set_and_canonicalize_value_range (vr, vr0.type, new_min, new_max, NULL); return; @@ -3141,7 +3171,7 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop, gimple stmt, tree var) { - tree init, step, chrec, tmin, tmax, min, max, type; + tree init, step, chrec, tmin, tmax, min, max, type, tem; enum ev_direction dir; /* TODO. Don't adjust anti-ranges. An anti-range may provide @@ -3162,7 +3192,13 @@ return; init = initial_condition_in_loop_num (chrec, loop->num); + tem = op_with_constant_singleton_value_range (init); + if (tem) + init = tem; step = evolution_part_in_loop_num (chrec, loop->num); + tem = op_with_constant_singleton_value_range (step); + if (tem) + step = tem; /* If STEP is symbolic, we can't know whether INIT will be the minimum or maximum value in the range. Also, unless INIT is @@ -6400,8 +6436,19 @@ /* If the new range is different than the previous value, keep iterating. */ if (update_value_range (lhs, &vr_result)) - return SSA_PROP_INTERESTING; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Found new range for "); + print_generic_expr (dump_file, lhs, 0); + fprintf (dump_file, ": "); + dump_value_range (dump_file, &vr_result); + fprintf (dump_file, "\n\n"); + } + return SSA_PROP_INTERESTING; + } + /* Nothing changed, don't add outgoing edges. */ return SSA_PROP_NOT_INTERESTING; Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/doc/sourcebuild.texi (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1094,9 +1094,12 @@ /* @{ dg-skip-if "" @{ *-*-* @} @{ "-O2 -g" "-O3 -g" @} @{ "-fpic" @} @} */ @end smallexample -@item @{ dg-require-effective-target @var{keyword} @} +@item @{ dg-require-effective-target @var{keyword} [@{ @var{selector} @}] @} Skip the test if the test target, including current multilib flags, is not covered by the effective-target keyword. +If the directive includes the optional @samp{@{ @var{selector} @}} +then the effective-target test is only performed if the target system +matches the @var{selector}. This directive must appear after any @code{dg-do} directive in the test and before any @code{dg-additional-sources} directive. @xref{Effective-Target Keywords, , }. @@ -1595,6 +1598,9 @@ @item hard_float Target supports FPU instructions. +@item sse2 +Target supports compiling @code{sse2} instructions. + @item sync_char_short Target supports atomic operations on @code{char} and @code{short}. @@ -1794,6 +1800,9 @@ @subsubsection Local to tests in @code{gcc.target/i386} @table @code +@item 3dnow +Target supports compiling @code{3dnow} instructions. + @item aes Target supports compiling @code{aes} instructions. @@ -1806,6 +1815,9 @@ @item pclmul Target supports compiling @code{pclmul} instructions. +@item sse3 +Target supports compiling @code{sse3} instructions. + @item sse4 Target supports compiling @code{sse4} instructions. Index: gcc/doc/standards.texi =================================================================== --- gcc/doc/standards.texi (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/doc/standards.texi (.../branches/gcc-4_5-branch) (wersja 159624) @@ -183,7 +183,7 @@ available on the ISO C++ committee's web site at @uref{http://www.open-std.org/jtc1/sc22/wg21/}. For information regarding the C++0x features available in the experimental C++0x mode, -see @uref{http://gcc.gnu.org/gcc-4.3/cxx0x_status.html}. To select this +see @uref{http://gcc.gnu.org/projects/cxx0x.html}. To select this standard in GCC, use the option @option{-std=c++0x}; to obtain all the diagnostics required by the standard, you should also specify @option{-pedantic} (or @option{-pedantic-errors} if you want them to be Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/doc/install.texi (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1233,6 +1233,10 @@ Specify that the user visible @command{cpp} program should be installed in @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}. +@item --enable-comdat +Enable COMDAT group support. This is primarily used to override the +automatically detected value. + @item --enable-initfini-array Force the use of sections @code{.init_array} and @code{.fini_array} (instead of @code{.init} and @code{.fini}) for constructors and Index: gcc/DATESTAMP =================================================================== --- gcc/DATESTAMP (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/DATESTAMP (.../branches/gcc-4_5-branch) (wersja 159624) @@ -1 +1 @@ -20100414 +20100520 Index: gcc/tree-tailcall.c =================================================================== --- gcc/tree-tailcall.c (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/tree-tailcall.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -375,6 +375,8 @@ tree m, a; basic_block abb; size_t idx; + tree var; + referenced_var_iterator rvi; if (!single_succ_p (bb)) return; @@ -462,6 +464,16 @@ tail_recursion = true; } + /* Make sure the tail invocation of this function does not refer + to local variables. */ + FOR_EACH_REFERENCED_VAR (var, rvi) + { + if (TREE_CODE (var) != PARM_DECL + && auto_var_in_fn_p (var, cfun->decl) + && ref_maybe_used_by_stmt_p (call, var)) + return; + } + /* Now check the statements after the call. None of them has virtual operands, so they may only depend on the call through its return value. The return value should also be dependent on each of them, Index: gcc/tree.c =================================================================== --- gcc/tree.c (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/tree.c (.../branches/gcc-4_5-branch) (wersja 159624) @@ -4265,7 +4265,12 @@ TYPE_LANG_SLOT_1 (type) = NULL_TREE; } - TYPE_CONTEXT (type) = NULL_TREE; + if (debug_info_level < DINFO_LEVEL_TERSE + || (TYPE_CONTEXT (type) + && TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_DECL + && TREE_CODE (TYPE_CONTEXT (type)) != NAMESPACE_DECL)) + TYPE_CONTEXT (type) = NULL_TREE; + if (debug_info_level < DINFO_LEVEL_TERSE) TYPE_STUB_DECL (type) = NULL_TREE; } @@ -4368,7 +4373,8 @@ /* Ignore any intervening types, because we are going to clear their TYPE_CONTEXT fields. */ - if (TREE_CODE (decl) != FIELD_DECL) + if (TREE_CODE (decl) != FIELD_DECL + && TREE_CODE (decl) != FUNCTION_DECL) DECL_CONTEXT (decl) = decl_function_context (decl); if (DECL_CONTEXT (decl) @@ -7919,7 +7925,8 @@ auto_var_in_fn_p (const_tree var, const_tree fn) { return (DECL_P (var) && DECL_CONTEXT (var) == fn - && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL) + && ((((TREE_CODE (var) == VAR_DECL && ! DECL_EXTERNAL (var)) + || TREE_CODE (var) == PARM_DECL) && ! TREE_STATIC (var)) || TREE_CODE (var) == LABEL_DECL || TREE_CODE (var) == RESULT_DECL)); Index: gcc/configure =================================================================== --- gcc/configure (.../tags/gcc_4_5_0_release) (wersja 159624) +++ gcc/configure (.../branches/gcc-4_5-branch) (wersja 159624) @@ -893,6 +893,7 @@ enable_sjlj_exceptions with_system_libunwind enable_secureplt +enable_leading_mingw64_underscores enable_cld enable_win32_registry enable_static @@ -900,6 +901,7 @@ enable_fast_install enable_libtool_lock with_plugin_ld +enable_comdat enable_gnu_unique_object enable_linker_build_id with_long_double_128 @@ -1589,6 +1591,8 @@ --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling --enable-secureplt enable -msecure-plt by default for PowerPC + --enable-leading-mingw64-underscores + Enable leading underscores on 64 bit mingw targets --enable-cld enable -mcld by default for 32bit x86 --disable-win32-registry disable lookup of installation paths in the @@ -1602,6 +1606,7 @@ --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-comdat enable COMDAT group support --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on glibc systems --enable-linker-build-id @@ -10628,6 +10633,17 @@ fi +# Check whether --enable-leading-mingw64-underscores was given. +if test "${enable_leading_mingw64_underscores+set}" = set; then : + enableval=$enable_leading_mingw64_underscores; +fi + +if test x"$enable_leading_mingw64_underscores" = xyes ; then : + +$as_echo "#define USE_MINGW64_LEADING_UNDERSCORES 1" >>confdefs.h + +fi + # Check whether --enable-cld was given. if test "${enable_cld+set}" = set; then : enableval=$enable_cld; @@ -17037,7 +17053,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17040 "configure" +#line 17056 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17143,7 +17159,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17146 "configure" +#line 17162 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -21174,8 +21190,36 @@ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - gcc_cv_as_hidden=yes + +# Solaris 9/x86 as incorrectly emits an alias for a hidden symbol with +# STV_HIDDEN, so disable .hidden support if so. +case "${target}" in + i?86-*-solaris2*) + if test x$gcc_cv_as != x && test x$gcc_cv_objdump != x; then + cat > conftest.s <