This commit is contained in:
Jakub Jelinek 2007-07-04 20:06:39 +00:00
parent cdb0987e55
commit 6ca4426344
8 changed files with 121 additions and 327 deletions

View File

@ -1 +1 @@
gcc-4.1.2-20070626.tar.bz2 gcc-4.1.2-20070704.tar.bz2

View File

@ -1,43 +0,0 @@
2007-05-01 Jakub Jelinek <jakub@redhat.com>
PR c++/31748
* semantics.c (finish_omp_clauses): Use %qD instead of %qE for
DECL_P in not a variable and appears more than once error messages.
* g++.dg/gomp/pr31748.C: New test.
--- gcc/cp/semantics.c.jj 2007-04-26 09:30:58.000000000 +0200
+++ gcc/cp/semantics.c 2007-05-01 14:22:58.000000000 +0200
@@ -3376,14 +3376,17 @@ finish_omp_clauses (tree clauses)
{
if (processing_template_decl)
break;
- error ("%qE is not a variable in clause %qs", t, name);
+ if (DECL_P (t))
+ error ("%qD is not a variable in clause %qs", t, name);
+ else
+ error ("%qE is not a variable in clause %qs", t, name);
remove = true;
}
else if (bitmap_bit_p (&generic_head, DECL_UID (t))
|| bitmap_bit_p (&firstprivate_head, DECL_UID (t))
|| bitmap_bit_p (&lastprivate_head, DECL_UID (t)))
{
- error ("%qE appears more than once in data clauses", t);
+ error ("%qD appears more than once in data clauses", t);
remove = true;
}
else
--- gcc/testsuite/g++.dg/gomp/pr31748.C.jj 2007-05-01 14:26:13.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/pr31748.C 2007-05-01 14:26:07.000000000 +0200
@@ -0,0 +1,10 @@
+// PR c++/31748
+
+struct A;
+
+void
+foo ()
+{
+#pragma omp parallel private(A) // { dg-error "struct A.*is not a variable" }
+ ;
+}

View File

@ -1,183 +0,0 @@
2007-06-25 Jakub Jelinek <jakub@redhat.com>
PR libgomp/32468
* omp-low.c (check_combined_parallel): New function.
(lower_omp_parallel): Call it via walk_stmts, set
OMP_PARALLEL_COMBINED if appropriate.
(determine_parallel_type): If OMP_FOR resp. OMP_SECTIONS
isn't the only statement in WS_ENTRY_BB or OMP_RETURN
the only one in PAR_EXIT_BB and not OMP_PARALLEL_COMBINED,
don't consider it as combined parallel.
--- gcc/omp-low.c.jj 2007-06-21 13:38:10.000000000 +0200
+++ gcc/omp-low.c 2007-06-25 19:21:35.000000000 +0200
@@ -385,10 +385,13 @@ determine_parallel_type (struct omp_regi
if (single_succ (par_entry_bb) == ws_entry_bb
&& single_succ (ws_exit_bb) == par_exit_bb
- && workshare_safe_to_combine_p (par_entry_bb, ws_entry_bb))
+ && workshare_safe_to_combine_p (par_entry_bb, ws_entry_bb)
+ && (OMP_PARALLEL_COMBINED (last_stmt (par_entry_bb))
+ || (last_and_only_stmt (ws_entry_bb)
+ && last_and_only_stmt (par_exit_bb))))
{
- tree ws_stmt = last_stmt (region->inner->entry);
+ tree ws_stmt = last_stmt (ws_entry_bb);
if (region->inner->type == OMP_FOR)
{
/* If this is a combined parallel loop, we need to determine
@@ -4060,6 +4065,28 @@ lower_omp_for (tree *stmt_p, omp_context
*stmt_p = new_stmt;
}
+/* Callback for walk_stmts. Check if *TP only contains OMP_FOR
+ or OMP_PARALLEL. */
+
+static tree
+check_combined_parallel (tree *tp, int *walk_subtrees, void *data)
+{
+ struct walk_stmt_info *wi = data;
+ int *info = wi->info;
+
+ *walk_subtrees = 0;
+ switch (TREE_CODE (*tp))
+ {
+ case OMP_FOR:
+ case OMP_SECTIONS:
+ *info = *info == 0 ? 1 : -1;
+ break;
+ default:
+ *info = -1;
+ break;
+ }
+ return NULL;
+}
/* Lower the OpenMP parallel directive in *STMT_P. CTX holds context
information for the directive. */
@@ -4077,6 +4104,19 @@ lower_omp_parallel (tree *stmt_p, omp_co
par_bind = OMP_PARALLEL_BODY (stmt);
par_body = BIND_EXPR_BODY (par_bind);
child_fn = ctx->cb.dst_fn;
+ if (!OMP_PARALLEL_COMBINED (stmt))
+ {
+ struct walk_stmt_info wi;
+ int ws_num = 0;
+
+ memset (&wi, 0, sizeof (wi));
+ wi.callback = check_combined_parallel;
+ wi.info = &ws_num;
+ wi.val_only = true;
+ walk_stmts (&wi, &par_bind);
+ if (ws_num == 1)
+ OMP_PARALLEL_COMBINED (stmt) = 1;
+ }
push_gimplify_context ();
--- gcc/testsuite/gcc.dg/gomp/pr32468-1.c.jj 2007-06-25 21:04:31.000000000 +0200
+++ gcc/testsuite/gcc.dg/gomp/pr32468-1.c 2007-06-25 21:07:35.000000000 +0200
@@ -0,0 +1,100 @@
+/* PR libgomp/32468 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */
+
+extern int printf (const char *, ...);
+extern int omp_get_thread_num (void), omp_get_num_threads (void);
+extern int bar (void);
+extern int baz (const char *, ...);
+
+void
+f1 (void)
+{
+#pragma omp parallel
+ {
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp sections
+ {
+ #pragma omp section
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp section
+ printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+ }
+}
+
+void
+f2 (void)
+{
+#pragma omp parallel
+ {
+ #pragma omp sections
+ {
+ #pragma omp section
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp section
+ printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+void
+f3 (void)
+{
+#pragma omp parallel
+ {
+ int bb = bar ();
+ #pragma omp sections
+ {
+ #pragma omp section
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp section
+ printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+ }
+}
+
+void
+f4 (void)
+{
+ int i;
+#pragma omp parallel
+ {
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp for schedule (dynamic, 15)
+ for (i = 0; i < 10000; i++)
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+void
+f5 (void)
+{
+ int i;
+#pragma omp parallel
+ {
+ #pragma omp for schedule (dynamic, 15)
+ for (i = 0; i < 10000; i++)
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+void
+f6 (void)
+{
+ int i;
+#pragma omp parallel
+ {
+ int bb = bar ();
+ #pragma omp for schedule (runtime)
+ for (i = 0; i < 10000; i++)
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+/* There should not be a GOMP_parallel_{loop,sections}* call. */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop" 0 "ompexp"} } */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_sections" 0 "ompexp"} } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
Jakub

View File

@ -1,54 +0,0 @@
2007-06-25 Jakub Jelinek <jakub@redhat.com>
PR libgomp/32468
* sections.c (GOMP_parallel_sections_start): Only decrease
number of threads to COUNT if dyn_var is true.
* libgomp.c/pr32468.c: New test.
--- libgomp/sections.c.jj 2006-10-05 00:24:40.000000000 +0200
+++ libgomp/sections.c 2007-06-25 22:03:17.000000000 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
@@ -106,7 +106,7 @@ GOMP_parallel_sections_start (void (*fn)
struct gomp_work_share *ws;
num_threads = gomp_resolve_num_threads (num_threads);
- if (num_threads > count)
+ if (gomp_dyn_var && num_threads > count)
num_threads = count;
ws = gomp_new_work_share (false, num_threads);
--- libgomp/testsuite/libgomp.c/pr32468.c.jj 2007-06-25 21:51:07.000000000 +0200
+++ libgomp/testsuite/libgomp.c/pr32468.c 2007-06-25 21:55:44.000000000 +0200
@@ -0,0 +1,26 @@
+/* PR libgomp/32468 */
+/* { dg-do run } */
+
+#include <omp.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ int res[2] = { -1, -1 };
+ omp_set_dynamic (0);
+ omp_set_num_threads (4);
+#pragma omp parallel
+ {
+ #pragma omp sections
+ {
+ #pragma omp section
+ res[0] = omp_get_num_threads () != 4;
+ #pragma omp section
+ res[1] = omp_get_num_threads () != 4;
+ }
+ }
+ if (res[0] != 0 || res[1] != 0)
+ abort ();
+ return 0;
+}

107
gcc41-pr32550.patch Normal file
View File

@ -0,0 +1,107 @@
2007-07-02 Jakub Jelinek <jakub@redhat.com>
PR fortran/32550
* trans.h (GFC_POINTER_TYPE_P): Define.
* trans-types.c (gfc_sym_type): Set it for types on attr->sym.pointer.
* trans-openmp.c (gfc_omp_privatize_by_reference): Return false
if GFC_POINTER_TYPE_P is set on the type.
* testsuite/libgomp.fortran/pr32550.f90: New test.
* testsuite/libgomp.fortran/crayptr2.f90: New test.
--- gcc/fortran/trans.h.jj 2007-05-30 14:54:52.000000000 +0200
+++ gcc/fortran/trans.h 2007-07-02 13:02:08.000000000 +0200
@@ -603,6 +603,8 @@ struct lang_decl GTY(())
#define GFC_DESCRIPTOR_TYPE_P(node) TYPE_LANG_FLAG_1(node)
/* An array without a descriptor. */
#define GFC_ARRAY_TYPE_P(node) TYPE_LANG_FLAG_2(node)
+/* Fortran POINTER type. */
+#define GFC_POINTER_TYPE_P(node) TYPE_LANG_FLAG_3(node)
/* The GFC_TYPE_ARRAY_* members are present in both descriptor and
descriptorless array types. */
#define GFC_TYPE_ARRAY_LBOUND(node, dim) \
--- gcc/fortran/trans-openmp.c.jj 2007-05-30 14:54:52.000000000 +0200
+++ gcc/fortran/trans-openmp.c 2007-07-02 13:10:19.000000000 +0200
@@ -50,9 +50,12 @@ gfc_omp_privatize_by_reference (tree dec
if (TREE_CODE (type) == POINTER_TYPE)
{
- /* POINTER/ALLOCATABLE have aggregate types, all user variables
- that have POINTER_TYPE type are supposed to be privatized
- by reference. */
+ /* Array POINTER/ALLOCATABLE have aggregate types, all user variables
+ that have POINTER_TYPE type and don't have GFC_POINTER_TYPE_P
+ set are supposed to be privatized by reference. */
+ if (GFC_POINTER_TYPE_P (type))
+ return false;
+
if (!DECL_ARTIFICIAL (decl))
return true;
--- gcc/fortran/trans-types.c.jj 2007-06-13 17:38:49.000000000 +0200
+++ gcc/fortran/trans-types.c 2007-07-02 13:03:22.000000000 +0200
@@ -1364,6 +1364,8 @@ gfc_sym_type (gfc_symbol * sym)
{
if (sym->attr.allocatable || sym->attr.pointer)
type = gfc_build_pointer_type (sym, type);
+ if (sym->attr.pointer)
+ GFC_POINTER_TYPE_P (type) = 1;
}
/* We currently pass all parameters by reference.
--- libgomp/testsuite/libgomp.fortran/crayptr2.f90.jj 2007-07-02 13:23:11.000000000 +0200
+++ libgomp/testsuite/libgomp.fortran/crayptr2.f90 2007-07-02 13:38:34.000000000 +0200
@@ -0,0 +1,30 @@
+! { dg-do run }
+! { dg-options "-fopenmp -fcray-pointer" }
+
+ use omp_lib
+ integer :: a, b, c, d, p
+ logical :: l
+ pointer (ip, p)
+ save ip
+!$omp threadprivate (ip)
+ a = 1
+ b = 2
+ c = 3
+ l = .false.
+!$omp parallel num_threads (3) reduction (.or.:l)
+ if (omp_get_thread_num () .eq. 0) then
+ ip = loc (a)
+ elseif (omp_get_thread_num () .eq. 1) then
+ ip = loc (b)
+ else
+ ip = loc (c)
+ end if
+ l = p .ne. omp_get_thread_num () + 1
+!$omp single
+ d = omp_get_thread_num ()
+!$omp end single copyprivate (d, ip)
+ l = l .or. (p .ne. d + 1)
+!$omp end parallel
+
+ if (l) call abort
+end
--- libgomp/testsuite/libgomp.fortran/pr32550.f90.jj 2007-07-02 13:17:59.000000000 +0200
+++ libgomp/testsuite/libgomp.fortran/pr32550.f90 2007-07-02 13:18:10.000000000 +0200
@@ -0,0 +1,20 @@
+! PR fortran/32550
+! { dg-do run }
+
+ integer, pointer, save :: ptr
+ integer, target :: targ
+ integer :: e
+!$omp threadprivate(ptr)
+ e = 0
+ targ = 42
+!$omp parallel shared(targ)
+!$omp single
+ ptr => targ
+!$omp end single copyprivate(ptr)
+ if (ptr.ne.42) then
+!$omp atomic
+ e = e + 1
+ end if
+!$omp end parallel
+ if (e.ne.0) call abort
+ end

View File

@ -1,35 +0,0 @@
2007-06-25 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Ensure
decl is non-external for AIX ABI.
2007-06-25 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/predicates.md (current_file_function_operand):
Ensure the symbol is non-external for AIX ABI.
--- gcc/config/rs6000/rs6000.c.jj 2007-06-25 22:22:41.000000000 +0200
+++ gcc/config/rs6000/rs6000.c 2007-06-25 23:11:20.000000000 +0200
@@ -13938,7 +13938,8 @@ rs6000_function_ok_for_sibcall (tree dec
}
}
if (DEFAULT_ABI == ABI_DARWIN
- || (*targetm.binds_local_p) (decl))
+ || ((*targetm.binds_local_p) (decl)
+ && (DEFAULT_ABI != ABI_AIX || !DECL_EXTERNAL (decl))))
{
tree attr_list = TYPE_ATTRIBUTES (TREE_TYPE (decl));
--- gcc/config/rs6000/predicates.md.jj 2007-06-25 22:22:41.000000000 +0200
+++ gcc/config/rs6000/predicates.md 2007-06-25 22:57:19.000000000 +0200
@@ -696,7 +696,9 @@
(define_predicate "current_file_function_operand"
(and (match_code "symbol_ref")
(match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))
- && (SYMBOL_REF_LOCAL_P (op)
+ && ((SYMBOL_REF_LOCAL_P (op)
+ && (DEFAULT_ABI != ABI_AIX
+ || !SYMBOL_REF_EXTERNAL_P (op)))
|| (op == XEXP (DECL_RTL (current_function_decl),
0)))")))

View File

@ -1,6 +1,6 @@
%define DATE 20070626 %define DATE 20070704
%define gcc_version 4.1.2 %define gcc_version 4.1.2
%define gcc_release 14 %define gcc_release 15
%define _unpackaged_files_terminate_build 0 %define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64 %define multilib_64_archs sparc64 ppc64 s390x x86_64
%define include_gappletviewer 1 %define include_gappletviewer 1
@ -130,11 +130,8 @@ Patch18: gcc41-libjava-visibility.patch
Patch19: gcc41-pr32139.patch Patch19: gcc41-pr32139.patch
Patch20: gcc41-rh236895.patch Patch20: gcc41-rh236895.patch
Patch21: gcc41-rh235008.patch Patch21: gcc41-rh235008.patch
Patch22: gcc41-pr31748.patch Patch22: gcc41-pr32550.patch
Patch23: gcc41-pr28690.patch Patch23: gcc41-pr28690.patch
Patch24: gcc41-pr32468.patch
Patch25: gcc41-pr32468-2.patch
Patch26: gcc41-rh245424.patch
%define _gnu %{nil} %define _gnu %{nil}
%ifarch sparc %ifarch sparc
@ -435,11 +432,8 @@ which are required to run programs compiled with the GNAT.
%patch19 -p0 -b .pr32139~ %patch19 -p0 -b .pr32139~
%patch20 -p0 -b .rh236895~ %patch20 -p0 -b .rh236895~
%patch21 -p0 -b .rh235008~ %patch21 -p0 -b .rh235008~
%patch22 -p0 -b .pr31748~ %patch22 -p0 -b .pr32550~
%patch23 -p0 -b .pr28690~ %patch23 -p0 -b .pr28690~
%patch24 -p0 -b .pr32468~
%patch25 -p0 -b .pr32468-2~
%patch26 -p0 -b .rh245424~
sed -i -e 's/4\.1\.3/4.1.2/' gcc/BASE-VER gcc/version.c sed -i -e 's/4\.1\.3/4.1.2/' gcc/BASE-VER gcc/version.c
sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@ -1563,6 +1557,14 @@ fi
%doc rpm.doc/changelogs/libmudflap/ChangeLog* %doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog %changelog
* Wed Jul 4 2007 Jakub Jelinek <jakub@redhat.com> 4.1.2-15
- update from gcc-4_1-branch (-r126008:126302)
- PRs boehm-gc/21940, boehm-gc/21942, target/28307, target/32506,
tree-optimization/31966, tree-optimization/32533
- merge in redhat/gcc-4_1-jdwp-merge-branch
- JDWP support (Keith Seitz)
- fix OpenMP handling of Fortran POINTER non-array vars (PR fortran/32550)
* Tue Jun 26 2007 Jakub Jelinek <jakub@redhat.com> 4.1.2-14 * Tue Jun 26 2007 Jakub Jelinek <jakub@redhat.com> 4.1.2-14
- update from gcc-4_1-branch (-r125727:126008) - update from gcc-4_1-branch (-r125727:126008)
- PRs inline-asm/32109, rtl-optimization/28011, target/32389 - PRs inline-asm/32109, rtl-optimization/28011, target/32389

View File

@ -1 +1 @@
2f8e1722614b0f385e61c9ca7e8ae945 gcc-4.1.2-20070626.tar.bz2 96b1b8c5dc4f0b9c354586a58d4e43e2 gcc-4.1.2-20070704.tar.bz2