SOURCES: gcc-branch.diff - updated to 4.3.1 branch diff.
pluto
pluto at pld-linux.org
Thu Mar 13 22:00:25 CET 2008
Author: pluto Date: Thu Mar 13 21:00:25 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- updated to 4.3.1 branch diff.
---- Files affected:
SOURCES:
gcc-branch.diff (1.8 -> 1.9)
---- Diffs:
================================================================
Index: SOURCES/gcc-branch.diff
diff -u SOURCES/gcc-branch.diff:1.8 SOURCES/gcc-branch.diff:1.9
--- SOURCES/gcc-branch.diff:1.8 Wed Oct 10 14:01:22 2007
+++ SOURCES/gcc-branch.diff Thu Mar 13 22:00:19 2008
@@ -1,724 +1,3557 @@
-Index: gcc/tree-vrp.c
+Index: libgomp/ChangeLog
===================================================================
---- gcc/tree-vrp.c (.../tags/gcc_4_2_2_release) (revision 129201)
-+++ gcc/tree-vrp.c (.../branches/gcc-4_2-branch) (revision 129201)
-@@ -2486,6 +2486,10 @@
- if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
- return;
+--- libgomp/ChangeLog (.../tags/gcc_4_3_0_release) (revision 133190)
++++ libgomp/ChangeLog (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -1,3 +1,17 @@
++2008-03-13 Jakub Jelinek <jakub at redhat.com>
++
++ PR middle-end/35185
++ * testsuite/libgomp.c++/pr35185.C: New test.
++
++2008-03-12 Jakub Jelinek <jakub at redhat.com>
++
++ PR middle-end/35549
++ * testsuite/libgomp.c/pr35549.c: New test.
++
++2008-03-06 Jakub Jelinek <jakub at redhat.com>
++
++ * testsuite/libgomp.c/atomic-3.c: New test.
++
+ 2008-03-05 Release Manager
-+ /* Don't adjust ranges from pointer CHRECs. */
-+ if (POINTER_TYPE_P (TREE_TYPE (chrec)))
-+ return;
+ * GCC 4.3.0 released.
+Index: libgomp/testsuite/libgomp.c++/pr35185.C
+===================================================================
+--- libgomp/testsuite/libgomp.c++/pr35185.C (.../tags/gcc_4_3_0_release) (revision 0)
++++ libgomp/testsuite/libgomp.c++/pr35185.C (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -0,0 +1,33 @@
++// PR middle-end/35185
++// { dg-do run }
+
- init = initial_condition_in_loop_num (chrec, loop->num);
- step = evolution_part_in_loop_num (chrec, loop->num);
++extern "C" void abort ();
++
++struct S
++{
++ S () : s (6) {}
++ ~S () {}
++ int s;
++};
++
++__attribute__((noinline))
++bool
++bar (S s)
++{
++ return s.s != 6;
++}
++
++int
++main ()
++{
++ S s;
++ int err = 0;
++#pragma omp parallel shared (s)
++ {
++ if (bar (s))
++ #pragma omp atomic
++ err++;
++ }
++ if (err)
++ abort ();
++}
+Index: libgomp/testsuite/libgomp.c/pr35549.c
+===================================================================
+--- libgomp/testsuite/libgomp.c/pr35549.c (.../tags/gcc_4_3_0_release) (revision 0)
++++ libgomp/testsuite/libgomp.c/pr35549.c (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -0,0 +1,30 @@
++/* PR middle-end/35549 */
++/* { dg-do run } */
++
++#include <omp.h>
++#include <stdlib.h>
++
++int
++main (void)
++{
++ int i = 6, n = 0;
++ omp_set_dynamic (0);
++ omp_set_nested (1);
++ #pragma omp parallel shared (i) num_threads (3)
++ {
++ if (omp_get_num_threads () != 3)
++ #pragma omp atomic
++ n += 1;
++ #pragma omp parallel shared (i) num_threads (4)
++ {
++ if (omp_get_num_threads () != 4)
++ #pragma omp atomic
++ n += 1;
++ #pragma omp critical
++ i += 1;
++ }
++ }
++ if (n == 0 && i != 6 + 3 * 4)
++ abort ();
++ return 0;
++}
+Index: libgomp/testsuite/libgomp.c/atomic-3.c
+===================================================================
+--- libgomp/testsuite/libgomp.c/atomic-3.c (.../tags/gcc_4_3_0_release) (revision 0)
++++ libgomp/testsuite/libgomp.c/atomic-3.c (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -0,0 +1,50 @@
++/* { dg-do run } */
++/* { dg-options "-fopenmp -O0" } */
++
++#include <omp.h>
++#include <stdlib.h>
++
++short e[64];
++int g;
++_Complex double d, f;
++int num_threads;
++
++__attribute__((noinline)) void
++foo (int x, long long y)
++{
++#pragma omp parallel num_threads (4)
++ {
++ int i;
++ #pragma omp barrier
++ for (i = 0; i < 2400; i++)
++ {
++ if (i == 0)
++ num_threads = omp_get_num_threads ();
++ #pragma omp atomic
++ e[0] += x;
++ #pragma omp atomic
++ e[16] += x;
++ #pragma omp atomic
++ g += y;
++ #pragma omp atomic
++ __real__ d += x;
++ #pragma omp atomic
++ __imag__ f += x;
++ }
++ }
++}
++
++int
++main (void)
++{
++ int i;
++ foo (3, 3LL);
++ if (g != 3 * 2400 * num_threads
++ || __real__ d != g || __imag__ d != 0
++ || __real__ f != 0 || __imag__ f != g)
++ abort ();
++ for (i = 0; i < 64; i++)
++ if (e[i] != ((i && i != 16) ? 0 : g))
++ abort ();
++ return 0;
++}
+Index: gcc/doc/include/texinfo.tex
+===================================================================
+--- gcc/doc/include/texinfo.tex (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/doc/include/texinfo.tex (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -3,7 +3,7 @@
+ % Load plain if necessary, i.e., if running under initex.
+ \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+ %
+-\def\texinfoversion{2008-02-04.16}
++\def\texinfoversion{2008-03-07.10}
+ %
+ % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+ % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+@@ -917,16 +917,21 @@
+ \temp
+ }
+-% @include file insert text of that file as input.
++% @include FILE -- \input text of FILE.
+ %
+ \def\include{\parseargusing\filenamecatcodes\includezzz}
+ \def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+- \makevalueexpandable
+- \input #1
+- }%
++ \makevalueexpandable % we want to expand any @value in FILE.
++ \turnoffactive % and allow special characters in the expansion
++ \edef\temp{\noexpand\input #1 }%
++ %
++ % This trickery is to read FILE outside of a group, in case it makes
++ % definitions, etc.
++ \expandafter
++ }\temp
+ \popthisfilestack
+ }
+ \def\filenamecatcodes{%
+@@ -5725,7 +5730,7 @@
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+- \expandafter \let\csname top \endcsname=\ptextop % outer
++ \expandafter \let\csname top\endcsname=\ptextop % outer
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+Index: gcc/java/jcf-parse.c
+===================================================================
+--- gcc/java/jcf-parse.c (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/java/jcf-parse.c (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -1208,7 +1208,7 @@
+ #ifdef USE_MAPPED_LOCATION
+ {
+ tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
+- const char *sfname = IDENTIFIER_POINTER (source_name);
++ const char *sfname = find_sourcefile (IDENTIFIER_POINTER (source_name));
+ linemap_add (line_table, LC_ENTER, false, sfname, 0);
+ input_location = linemap_line_start (line_table, 0, 1);
+ file_start_location = input_location;
+Index: gcc/java/ChangeLog
+===================================================================
+--- gcc/java/ChangeLog (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/java/ChangeLog (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -1,3 +1,8 @@
++2008-03-06 Andrew Haley <aph at redhat.com>
++
++ * jcf-parse.c (give_name_to_class): Call find_sourcefile to find
++ full pathname of source file.
++
+ 2008-03-05 Release Manager
+
+ * GCC 4.3.0 released.
Index: gcc/DATESTAMP
===================================================================
---- gcc/DATESTAMP (.../tags/gcc_4_2_2_release) (revision 129201)
-+++ gcc/DATESTAMP (.../branches/gcc-4_2-branch) (revision 129201)
+--- gcc/DATESTAMP (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/DATESTAMP (.../branches/gcc-4_3-branch) (revision 133190)
@@ -1 +1 @@
--20071007
-+20071010
+-20080305
++20080313
+Index: gcc/tree.c
+===================================================================
+--- gcc/tree.c (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/tree.c (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -4067,6 +4067,16 @@
+ return NULL_TREE;
+ }
+
++ if (TREE_CODE (node) == TYPE_DECL
++ && TREE_CODE (TREE_TYPE (node)) != RECORD_TYPE
++ && TREE_CODE (TREE_TYPE (node)) != UNION_TYPE)
++ {
++ *no_add_attrs = true;
++ warning (OPT_Wattributes, "%qs attribute ignored",
++ IDENTIFIER_POINTER (name));
++ return NULL_TREE;
++ }
++
+ /* Report error on dllimport ambiguities seen now before they cause
+ any damage. */
+ else if (is_attribute_p ("dllimport", name))
+Index: gcc/fold-const.c
+===================================================================
+--- gcc/fold-const.c (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/fold-const.c (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -5066,9 +5066,10 @@
+
+ Note that all these transformations are correct if A is
+ NaN, since the two alternatives (A and -A) are also NaNs. */
+- if ((FLOAT_TYPE_P (TREE_TYPE (arg01))
+- ? real_zerop (arg01)
+- : integer_zerop (arg01))
++ if (!HONOR_SIGNED_ZEROS (TYPE_MODE (type))
++ && (FLOAT_TYPE_P (TREE_TYPE (arg01))
++ ? real_zerop (arg01)
++ : integer_zerop (arg01))
+ && ((TREE_CODE (arg2) == NEGATE_EXPR
+ && operand_equal_p (TREE_OPERAND (arg2, 0), arg1, 0))
+ /* In the case that A is of the form X-Y, '-A' (arg2) may
+@@ -5121,7 +5122,8 @@
+ both transformations are correct when A is NaN: A != 0
+ is then true, and A == 0 is false. */
+
+- if (integer_zerop (arg01) && integer_zerop (arg2))
++ if (!HONOR_SIGNED_ZEROS (TYPE_MODE (type))
++ && integer_zerop (arg01) && integer_zerop (arg2))
+ {
+ if (comp_code == NE_EXPR)
+ return pedantic_non_lvalue (fold_convert (type, arg1));
+@@ -5155,7 +5157,8 @@
+ a number and A is not. The conditions in the original
+ expressions will be false, so all four give B. The min()
+ and max() versions would give a NaN instead. */
+- if (operand_equal_for_comparison_p (arg01, arg2, arg00)
++ if (!HONOR_SIGNED_ZEROS (TYPE_MODE (type))
++ && operand_equal_for_comparison_p (arg01, arg2, arg00)
+ /* Avoid these transformations if the COND_EXPR may be used
+ as an lvalue in the C++ front-end. PR c++/19199. */
+ && (in_gimple_form
+Index: gcc/omp-low.c
+===================================================================
+--- gcc/omp-low.c (.../tags/gcc_4_3_0_release) (revision 133190)
++++ gcc/omp-low.c (.../branches/gcc-4_3-branch) (revision 133190)
+@@ -456,7 +456,7 @@
+ }
+
+ static inline tree
+-maybe_lookup_decl (tree var, omp_context *ctx)
++maybe_lookup_decl (const_tree var, omp_context *ctx)
+ {
+ tree *n;
+ n = (tree *) pointer_map_contains (ctx->cb.decl_map, var);
+@@ -479,18 +479,18 @@
+ return n ? (tree) n->value : NULL_TREE;
+ }
+
+-/* Return true if DECL should be copied by pointer. SHARED_P is true
+- if DECL is to be shared. */
++/* Return true if DECL should be copied by pointer. SHARED_CTX is
++ the parallel context if DECL is to be shared. */
+
+ static bool
+-use_pointer_for_field (const_tree decl, bool shared_p)
++use_pointer_for_field (const_tree decl, omp_context *shared_ctx)
+ {
+ if (AGGREGATE_TYPE_P (TREE_TYPE (decl)))
+ return true;
+
+ /* We can only use copy-in/copy-out semantics for shared variables
+ when we know the value is not accessible from an outer scope. */
+- if (shared_p)
++ if (shared_ctx)
+ {
+ /* ??? Trivially accessible from anywhere. But why would we even
+ be passing an address in this case? Should we simply assert
+@@ -510,6 +510,34 @@
+ address taken. */
+ if (TREE_ADDRESSABLE (decl))
+ return true;
++
++ /* Disallow copy-in/out in nested parallel if
++ decl is shared in outer parallel, otherwise
++ each thread could store the shared variable
++ in its own copy-in location, making the
++ variable no longer really shared. */
++ if (!TREE_READONLY (decl) && shared_ctx->is_nested)
++ {
++ omp_context *up;
++
++ for (up = shared_ctx->outer; up; up = up->outer)
++ if (maybe_lookup_decl (decl, up))
++ break;
++
++ if (up && is_parallel_ctx (up))
++ {
++ tree c;
++
++ for (c = OMP_PARALLEL_CLAUSES (up->stmt);
++ c; c = OMP_CLAUSE_CHAIN (c))
++ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED
++ && OMP_CLAUSE_DECL (c) == decl)
++ break;
++
++ if (c)
++ return true;
++ }
++ }
+ }
+
+ return false;
+@@ -596,7 +624,7 @@
+ }
+ else if (is_parallel_ctx (ctx))
+ {
+- bool by_ref = use_pointer_for_field (var, false);
++ bool by_ref = use_pointer_for_field (var, NULL);
+ x = build_receiver_ref (var, by_ref, ctx);
+ }
+ else if (ctx->outer)
+@@ -966,7 +994,7 @@
+ gcc_assert (is_parallel_ctx (ctx));
+ decl = OMP_CLAUSE_DECL (c);
+ gcc_assert (!is_variable_sized (decl));
+- by_ref = use_pointer_for_field (decl, true);
++ by_ref = use_pointer_for_field (decl, ctx);
+ /* Global variables don't need to be copied,
+ the receiver side will use them directly. */
+ if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)))
+@@ -1001,7 +1029,7 @@
+ && ! is_global_var (maybe_lookup_decl_in_outer_ctx (decl,
+ ctx)))
+ {
+- by_ref = use_pointer_for_field (decl, false);
++ by_ref = use_pointer_for_field (decl, NULL);
+ install_var_field (decl, by_ref, ctx);
+ }
+ install_var_local (decl, ctx);
+@@ -1014,7 +1042,7 @@
+
+ case OMP_CLAUSE_COPYIN:
+ decl = OMP_CLAUSE_DECL (c);
+- by_ref = use_pointer_for_field (decl, false);
++ by_ref = use_pointer_for_field (decl, NULL);
+ install_var_field (decl, by_ref, ctx);
+ break;
+
+@@ -1751,7 +1779,7 @@
+ /* Set up the DECL_VALUE_EXPR for shared variables now. This
+ needs to be delayed until after fixup_child_record_type so
+ that we get the correct type during the dereference. */
+- by_ref = use_pointer_for_field (var, true);
++ by_ref = use_pointer_for_field (var, ctx);
+ x = build_receiver_ref (var, by_ref, ctx);
+ SET_DECL_VALUE_EXPR (new_var, x);
+ DECL_HAS_VALUE_EXPR_P (new_var) = 1;
+@@ -1794,7 +1822,7 @@
+ break;
+
+ case OMP_CLAUSE_COPYIN:
+- by_ref = use_pointer_for_field (var, false);
++ by_ref = use_pointer_for_field (var, NULL);
+ x = build_receiver_ref (var, by_ref, ctx);
+ x = lang_hooks.decls.omp_clause_assign_op (c, new_var, x);
+ append_to_statement_list (x, ©in_seq);
+@@ -2007,7 +2035,7 @@
+ continue;
+
+ var = OMP_CLAUSE_DECL (c);
+- by_ref = use_pointer_for_field (var, false);
++ by_ref = use_pointer_for_field (var, NULL);
+
+ ref = build_sender_ref (var, ctx);
+ x = lookup_decl_in_outer_ctx (var, ctx);
+@@ -2059,7 +2087,7 @@
+ continue;
+ if (is_variable_sized (val))
+ continue;
+- by_ref = use_pointer_for_field (val, false);
++ by_ref = use_pointer_for_field (val, NULL);
+
+ switch (OMP_CLAUSE_CODE (c))
+ {
+@@ -2129,7 +2157,7 @@
+ mapping for OVAR. */
+ var = lookup_decl_in_outer_ctx (ovar, ctx);
+
+- if (use_pointer_for_field (ovar, true))
++ if (use_pointer_for_field (ovar, ctx))
+ {
+ x = build_sender_ref (ovar, ctx);
+ var = build_fold_addr_expr (var);
+@@ -4852,184 +4880,177 @@
+ pop_gimplify_context (NULL_TREE);
+ }
+
++/* Callback for lower_omp_1. Return non-NULL if *tp needs to be
++ regimplified. */
+
+-/* Pass *TP back through the gimplifier within the context determined by WI.
+- This handles replacement of DECL_VALUE_EXPR, as well as adjusting the
+- flags on ADDR_EXPR. */
+-
+-static void
+-lower_regimplify (tree *tp, struct walk_stmt_info *wi)
++static tree
++lower_omp_2 (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
+ {
+- enum gimplify_status gs;
+- tree pre = NULL;
++ tree t = *tp;
+
+- if (wi->is_lhs)
+- gs = gimplify_expr (tp, &pre, NULL, is_gimple_lvalue, fb_lvalue);
+- else if (wi->val_only)
+- gs = gimplify_expr (tp, &pre, NULL, is_gimple_val, fb_rvalue);
+- else
+- gs = gimplify_expr (tp, &pre, NULL, is_gimple_formal_tmp_var, fb_rvalue);
+- gcc_assert (gs == GS_ALL_DONE);
++ /* Any variable with DECL_VALUE_EXPR needs to be regimplified. */
++ if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t))
++ return t;
+
+- if (pre)
+- tsi_link_before (&wi->tsi, pre, TSI_SAME_STMT);
+-}
++ /* If a global variable has been privatized, TREE_CONSTANT on
++ ADDR_EXPR might be wrong. */
++ if (TREE_CODE (t) == ADDR_EXPR)
++ recompute_tree_invariant_for_addr_expr (t);
+
+-/* Copy EXP into a temporary. Insert the initialization statement before TSI. */
+-
+-static tree
+-init_tmp_var (tree exp, tree_stmt_iterator *tsi)
+-{
+- tree t, stmt;
+-
+- t = create_tmp_var (TREE_TYPE (exp), NULL);
+- DECL_GIMPLE_REG_P (t) = 1;
+- stmt = build_gimple_modify_stmt (t, exp);
+- SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
+- tsi_link_before (tsi, stmt, TSI_SAME_STMT);
+-
+- return t;
++ *walk_subtrees = !TYPE_P (t) && !DECL_P (t);
++ return NULL_TREE;
+ }
+
+-/* Similarly, but copy from the temporary and insert the statement
+- after the iterator. */
+-
+-static tree
+-save_tmp_var (tree exp, tree_stmt_iterator *tsi)
++static void
++lower_omp_1 (tree *tp, omp_context *ctx, tree_stmt_iterator *tsi)
+ {
+- tree t, stmt;
++ tree t = *tp;
+
+- t = create_tmp_var (TREE_TYPE (exp), NULL);
+- DECL_GIMPLE_REG_P (t) = 1;
+- stmt = build_gimple_modify_stmt (exp, t);
+- SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
+- tsi_link_after (tsi, stmt, TSI_SAME_STMT);
++ if (!t)
++ return;
+
+- return t;
+-}
++ if (EXPR_HAS_LOCATION (t))
++ input_location = EXPR_LOCATION (t);
+
+-/* Callback for walk_stmts. Lower the OpenMP directive pointed by TP. */
+-
+-static tree
+-lower_omp_1 (tree *tp, int *walk_subtrees, void *data)
+-{
+- struct walk_stmt_info *wi = data;
+- omp_context *ctx = wi->info;
+- tree t = *tp;
+-
+ /* If we have issued syntax errors, avoid doing any heavy lifting.
+ Just replace the OpenMP directives with a NOP to avoid
+ confusing RTL expansion. */
+- if (errorcount && OMP_DIRECTIVE_P (*tp))
++ if (errorcount && OMP_DIRECTIVE_P (t))
+ {
+ *tp = build_empty_stmt ();
+- return NULL_TREE;
++ return;
+ }
+
+- *walk_subtrees = 0;
+- switch (TREE_CODE (*tp))
++ switch (TREE_CODE (t))
+ {
++ case STATEMENT_LIST:
++ {
++ tree_stmt_iterator i;
++ for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
++ lower_omp_1 (tsi_stmt_ptr (i), ctx, &i);
++ }
++ break;
++
++ case COND_EXPR:
++ lower_omp_1 (&COND_EXPR_THEN (t), ctx, NULL);
++ lower_omp_1 (&COND_EXPR_ELSE (t), ctx, NULL);
++ if (ctx
++ && walk_tree (&COND_EXPR_COND (t), lower_omp_2, ctx, NULL))
++ {
++ tree pre = NULL;
++ gimplify_expr (&COND_EXPR_COND (t), &pre, NULL,
++ is_gimple_condexpr, fb_rvalue);
++ if (pre)
++ {
++ if (tsi)
++ tsi_link_before (tsi, pre, TSI_SAME_STMT);
++ else
++ {
++ append_to_statement_list (t, &pre);
++ *tp = pre;
++ }
++ }
++ }
++ break;
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/gcc-branch.diff?r1=1.8&r2=1.9&f=u
More information about the pld-cvs-commit
mailing list