packages: gcc/gcc-branch.diff, gcc/gcc.spec - updated to 4.7.1.

pluto pluto at pld-linux.org
Thu Jun 14 22:46:49 CEST 2012


Author: pluto                        Date: Thu Jun 14 20:46:49 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- updated to 4.7.1.

---- Files affected:
packages/gcc:
   gcc-branch.diff (1.63 -> 1.64) , gcc.spec (1.693 -> 1.694) 

---- Diffs:

================================================================
Index: packages/gcc/gcc-branch.diff
diff -u packages/gcc/gcc-branch.diff:1.63 packages/gcc/gcc-branch.diff:1.64
--- packages/gcc/gcc-branch.diff:1.63	Sat May 26 11:42:03 2012
+++ packages/gcc/gcc-branch.diff	Thu Jun 14 22:43:26 2012
@@ -1,398100 +1,3603 @@
-Index: libitm/ChangeLog
+Index: libgomp/ChangeLog
 ===================================================================
---- libitm/ChangeLog	(.../tags/gcc_4_7_0_release)	(wersja 187906)
-+++ libitm/ChangeLog	(.../branches/gcc-4_7-branch)	(wersja 187906)
-@@ -1,3 +1,12 @@
-+2012-04-04  H.J. Lu  <hongjiu.lu at intel.com>
+--- libgomp/ChangeLog	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/ChangeLog	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -1,3 +1,23 @@
++2012-06-14  Jakub Jelinek  <jakub at redhat.com>
 +
 +	Backported from mainline
-+	2012-04-04  H.J. Lu  <hongjiu.lu at intel.com>
-+
-+	PR libitm/52854
-+	* config/x86/target.h (gtm_jmpbuf): Replace long with long long
-+	for x86-64.
++	2012-06-07  Jakub Jelinek  <jakub at redhat.com>
 +
- 2012-03-22  Release Manager
- 
- 	* GCC 4.7.0 released.
-Index: libitm/config/x86/target.h
++	PR middle-end/53580
++	* testsuite/libgomp.c/pr26943-2.c: Remove #pragma omp barrier,
++	use GOMP_barrier () call instead.
++	* testsuite/libgomp.c/pr26943-3.c: Likewise.
++	* testsuite/libgomp.c/pr26943-4.c: Likewise.
++	* testsuite/libgomp.fortran/vla4.f90: Remove !$omp barrier,
++	call GOMP_barrier instead.
++	* testsuite/libgomp.fortran/vla5.f90: Likewise.
++
++	2012-06-06  Jakub Jelinek  <jakub at redhat.com>
++
++	PR libgomp/52993
++	* config/linux/lock.c (gomp_init_nest_lock_25): Fix up last
++	argument to memset call.
++
+ 2012-06-14  Release Manager
+ 
+ 	* GCC 4.7.1 released.
+Index: libgomp/testsuite/libgomp.fortran/vla4.f90
+===================================================================
+--- libgomp/testsuite/libgomp.fortran/vla4.f90	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/testsuite/libgomp.fortran/vla4.f90	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -10,6 +10,10 @@
+ 
+   subroutine foo (c, d, e, f, g, h, i, j, k, n)
+     use omp_lib
++    interface
++      subroutine GOMP_barrier () bind(c, name="GOMP_barrier")
++      end subroutine
++    end interface
+     integer :: n
+     character (len = *) :: c
+     character (len = n) :: d
+@@ -94,7 +98,7 @@
+     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		! { dg-warning "may not be closely nested" }
++    call GOMP_barrier
+     y = ''
+     if (x .eq. 0) y = '0'
+     if (x .eq. 1) y = '1'
+Index: libgomp/testsuite/libgomp.fortran/vla5.f90
+===================================================================
+--- libgomp/testsuite/libgomp.fortran/vla5.f90	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/testsuite/libgomp.fortran/vla5.f90	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -10,6 +10,10 @@
+ 
+   subroutine foo (c, d, e, f, g, h, i, j, k, n)
+     use omp_lib
++    interface
++      subroutine GOMP_barrier () bind(c, name="GOMP_barrier")
++      end subroutine
++    end interface
+     integer :: n
+     character (len = *) :: c
+     character (len = n) :: d
+@@ -66,7 +70,7 @@
+     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		! { dg-warning "may not be closely nested" }
++    call GOMP_barrier
+     y = ''
+     if (x .eq. 0) y = '0'
+     if (x .eq. 1) y = '1'
+Index: libgomp/testsuite/libgomp.c/pr26943-2.c
+===================================================================
+--- libgomp/testsuite/libgomp.c/pr26943-2.c	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/testsuite/libgomp.c/pr26943-2.c	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -3,6 +3,7 @@
+ 
+ extern int omp_set_dynamic (int);
+ extern void abort (void);
++extern void GOMP_barrier (void);
+ 
+ int a = 8, b = 12, c = 16, d = 20, j = 0;
+ char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d";
+@@ -20,7 +21,7 @@
+     {
+       if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b')
+ 	j++;
+-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
++      GOMP_barrier ();
+ #pragma omp atomic
+       a += i;
+       b += i;
+@@ -31,7 +32,7 @@
+       f[0] += i;
+       g[0] = 'g' + i;
+       h[0] = 'h' + i;
+-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
++      GOMP_barrier ();
+       if (a != 8 + 6 || b != 12 + i || c != i || d != i)
+ 	j += 8;
+       if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i)
+Index: libgomp/testsuite/libgomp.c/pr26943-3.c
+===================================================================
+--- libgomp/testsuite/libgomp.c/pr26943-3.c	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/testsuite/libgomp.c/pr26943-3.c	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -4,6 +4,7 @@
+ extern int omp_set_dynamic (int);
+ extern int omp_get_thread_num (void);
+ extern void abort (void);
++extern void GOMP_barrier (void);
+ 
+ int a = 8, b = 12, c = 16, d = 20, j = 0, l = 0;
+ char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d";
+@@ -26,7 +27,7 @@
+ 	{
+ 	  if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b')
+ 	    j++;
+-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
++	  GOMP_barrier ();
+ #pragma omp atomic
+ 	  a += i;
+ 	  b += i;
+@@ -37,7 +38,7 @@
+ 	  f[0] += i;
+ 	  g[0] = 'g' + i;
+ 	  h[0] = 'h' + i;
+-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
++	  GOMP_barrier ();
+ 	  if (a != 8 + 6 || b != 12 + i || c != i || d != i)
+ 	    j += 8;
+ 	  if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i)
+Index: libgomp/testsuite/libgomp.c/pr26943-4.c
+===================================================================
+--- libgomp/testsuite/libgomp.c/pr26943-4.c	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/testsuite/libgomp.c/pr26943-4.c	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -4,6 +4,7 @@
+ extern int omp_set_dynamic (int);
+ extern int omp_get_thread_num (void);
+ extern void abort (void);
++extern void GOMP_barrier (void);
+ 
+ int a = 8, b = 12, c = 16, d = 20, j = 0, l = 0;
+ char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d";
+@@ -27,7 +28,7 @@
+ 	{
+ 	  if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b')
+ 	    j++;
+-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
++	  GOMP_barrier ();
+ #pragma omp atomic
+ 	  a += i;
+ 	  b += i;
+@@ -38,7 +39,7 @@
+ 	  f[0] += i;
+ 	  g[0] = 'g' + i;
+ 	  h[0] = 'h' + i;
+-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
++	  GOMP_barrier ();
+ 	  if (a != 8 + 6 || b != 12 + i || c != i || d != i)
+ 	    j += 8;
+ 	  if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i)
+Index: libgomp/config/linux/lock.c
 ===================================================================
---- libitm/config/x86/target.h	(.../tags/gcc_4_7_0_release)	(wersja 187906)
-+++ libitm/config/x86/target.h	(.../branches/gcc-4_7-branch)	(wersja 187906)
-@@ -29,13 +29,13 @@
- typedef struct gtm_jmpbuf
+--- libgomp/config/linux/lock.c	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ libgomp/config/linux/lock.c	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc.
++/* Copyright (C) 2005, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
+    Contributed by Richard Henderson <rth at redhat.com>.
+ 
+    This file is part of the GNU OpenMP Library (libgomp).
+@@ -175,7 +175,7 @@
+ void
+ gomp_init_nest_lock_25 (omp_nest_lock_25_t *lock)
  {
-   void *cfa;
--  unsigned long rbx;
--  unsigned long rbp;
--  unsigned long r12;
--  unsigned long r13;
--  unsigned long r14;
--  unsigned long r15;
--  unsigned long rip;
-+  unsigned long long rbx;
-+  unsigned long long rbp;
-+  unsigned long long r12;
-+  unsigned long long r13;
-+  unsigned long long r14;
-+  unsigned long long r15;
-+  unsigned long long rip;
- } gtm_jmpbuf;
- #else
- typedef struct gtm_jmpbuf
-Index: Makefile.in
-===================================================================
---- Makefile.in	(.../tags/gcc_4_7_0_release)	(wersja 187906)
-+++ Makefile.in	(.../branches/gcc-4_7-branch)	(wersja 187906)
-@@ -2426,11 +2426,12 @@
- 		true ; \
- 	fi
+-  memset (lock, 0, sizeof (lock));
++  memset (lock, 0, sizeof (*lock));
+ }
  
--# install-no-fixedincludes is used because Cygnus can not distribute
--# the fixed header files.
-+# install-no-fixedincludes is used to allow the elaboration of binary packages
-+# suitable for distribution, where we cannot include the fixed system header
-+# files.
- .PHONY: install-no-fixedincludes
- install-no-fixedincludes: installdirs install-host-nogcc \
--	install-target gcc-no-fixedincludes
-+	install-target gcc-install-no-fixedincludes
+ void
+Index: gcc/tree-ssa-loop-im.c
+===================================================================
+--- gcc/tree-ssa-loop-im.c	(.../tags/gcc_4_7_1_release)	(wersja 188635)
++++ gcc/tree-ssa-loop-im.c	(.../branches/gcc-4_7-branch)	(wersja 188635)
+@@ -52,7 +52,7 @@
+ 	 }
+      }
  
- .PHONY: install-strip
- install-strip:
-@@ -40721,25 +40722,16 @@
- check-go: check-gcc-go check-target-libgo
+-   Where COND and INV are is invariants, but evaluating INV may trap or be
++   Where COND and INV are invariants, but evaluating INV may trap or be
+    invalid from some other reason if !COND.  This may be transformed to
  
+    if (cond)
+@@ -1626,6 +1626,7 @@
+ 	  fprintf (dump_file, "\n");
+ 	}
+     }
++
+   if (is_stored)
+     mark_ref_stored (ref, loop);
  
--# Install the gcc headers files, but not the fixed include files,
--# which Cygnus is not allowed to distribute.  This rule is very
--# dependent on the workings of the gcc Makefile.in.
--.PHONY: gcc-no-fixedincludes
--gcc-no-fixedincludes:
-+# The gcc part of install-no-fixedincludes, which relies on an intimate
-+# knowledge of how a number of gcc internal targets (inter)operate.  Delegate.
-+.PHONY: gcc-install-no-fixedincludes
-+gcc-install-no-fixedincludes:
- 	@if [ -f ./gcc/Makefile ]; then \
--	  rm -rf gcc/tmp-include; \
--	  mv gcc/include gcc/tmp-include 2>/dev/null; \
--	  mkdir gcc/include; \
--	  cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
--	  touch gcc/stmp-fixinc gcc/include/fixed; \
--	  rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
- 	  r=`${PWD_COMMAND}`; export r; \
--	  s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
-+	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- 	  $(HOST_EXPORTS) \
--	  (cd ./gcc && \
--	   $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
--	  rm -rf gcc/include; \
--	  mv gcc/tmp-include gcc/include 2>/dev/null; \
-+	  (cd ./gcc \
-+	   && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
- 	else true; fi
- @endif gcc
+@@ -1956,6 +1957,173 @@
+   return lsm_tmp_name;
+ }
  
-Index: libgomp/ChangeLog
-===================================================================
---- libgomp/ChangeLog	(.../tags/gcc_4_7_0_release)	(wersja 187906)
-+++ libgomp/ChangeLog	(.../branches/gcc-4_7-branch)	(wersja 187906)
-@@ -1,3 +1,8 @@
-+2012-03-22  Jakub Jelinek  <jakub at redhat.com>
++struct prev_flag_edges {
++  /* Edge to insert new flag comparison code.  */
++  edge append_cond_position;
 +
-+	PR middle-end/52547
-+	* testsuite/libgomp.c/pr52547.c: New test.
++  /* Edge for fall through from previous flag comparison.  */
++  edge last_cond_fallthru;
++};
 +
- 2012-03-22  Release Manager
- 
- 	* GCC 4.7.0 released.
-Index: libgomp/testsuite/libgomp.c/pr52547.c
-===================================================================
---- libgomp/testsuite/libgomp.c/pr52547.c	(.../tags/gcc_4_7_0_release)	(wersja 0)
-+++ libgomp/testsuite/libgomp.c/pr52547.c	(.../branches/gcc-4_7-branch)	(wersja 187906)
-@@ -0,0 +1,36 @@
-+/* PR middle-end/52547 */
-+/* { dg-do run } */
++/* Helper function for execute_sm.  Emit code to store TMP_VAR into
++   MEM along edge EX.
 +
-+extern void abort (void);
++   The store is only done if MEM has changed.  We do this so no
++   changes to MEM occur on code paths that did not originally store
++   into it.
 +
-+__attribute__((noinline, noclone)) int
-+baz (int *x, int (*fn) (int *))
-+{
-+  return fn (x);
-+}
++   The common case for execute_sm will transform:
 +
-+__attribute__((noinline, noclone)) int
-+foo (int x, int *y)
++     for (...) {
++       if (foo)
++         stuff;
++       else
++         MEM = TMP_VAR;
++     }
++
++   into:
++
++     lsm = MEM;
++     for (...) {
++       if (foo)
++         stuff;
++       else
++         lsm = TMP_VAR;
++     }
++     MEM = lsm;
++
++  This function will generate:
++
++     lsm = MEM;
++
++     lsm_flag = false;
++     ...
++     for (...) {
++       if (foo)
++         stuff;
++       else {
++         lsm = TMP_VAR;
++         lsm_flag = true;
++       }
++     }
++     if (lsm_flag)	<--
++       MEM = lsm;	<--
++*/
++
++static void
++execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag)
 +{
-+  int i, e = 0;
-+#pragma omp parallel for reduction(|:e)
-+  for (i = 0; i < x; ++i)
-+    {
-+      __label__ lab;
-+      int bar (int *z) { return z - y; }
-+      if (baz (&y[i], bar) != i)
-+	e |= 1;
-+    }
-+  return e;
++  basic_block new_bb, then_bb, old_dest;
++  bool loop_has_only_one_exit;
++  edge then_old_edge, orig_ex = ex;
++  gimple_stmt_iterator gsi;
++  gimple stmt;
++  struct prev_flag_edges *prev_edges = (struct prev_flag_edges *) ex->aux;
++
++  /* ?? Insert store after previous store if applicable.  See note
++     below.  */
++  if (prev_edges)
++    ex = prev_edges->append_cond_position;
++
++  loop_has_only_one_exit = single_pred_p (ex->dest);
++
++  if (loop_has_only_one_exit)
++    ex = split_block_after_labels (ex->dest);
++
++  old_dest = ex->dest;
++  new_bb = split_edge (ex);
++  then_bb = create_empty_bb (new_bb);
++  if (current_loops && new_bb->loop_father)
++    add_bb_to_loop (then_bb, new_bb->loop_father);
++
++  gsi = gsi_start_bb (new_bb);
++  stmt = gimple_build_cond (NE_EXPR, flag, boolean_false_node,
++			    NULL_TREE, NULL_TREE);
++  gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
++
++  gsi = gsi_start_bb (then_bb);
++  /* Insert actual store.  */
++  stmt = gimple_build_assign (unshare_expr (mem), tmp_var);
++  gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
++
++  make_edge (new_bb, then_bb, EDGE_TRUE_VALUE);
++  make_edge (new_bb, old_dest, EDGE_FALSE_VALUE);
++  then_old_edge = make_edge (then_bb, old_dest, EDGE_FALLTHRU);
++
++  set_immediate_dominator (CDI_DOMINATORS, then_bb, new_bb);
++
++  if (prev_edges)
++    {
++      basic_block prevbb = prev_edges->last_cond_fallthru->src;
++      redirect_edge_succ (prev_edges->last_cond_fallthru, new_bb);
++      set_immediate_dominator (CDI_DOMINATORS, new_bb, prevbb);
++      set_immediate_dominator (CDI_DOMINATORS, old_dest,
++			       recompute_dominator (CDI_DOMINATORS, old_dest));
++    }
++
++  /* ?? Because stores may alias, they must happen in the exact
++     sequence they originally happened.  Save the position right after
++     the (_lsm) store we just created so we can continue appending after
++     it and maintain the original order.  */
++  {
++    struct prev_flag_edges *p;
++
++    if (orig_ex->aux)
++      orig_ex->aux = NULL;
++    alloc_aux_for_edge (orig_ex, sizeof (struct prev_flag_edges));
++    p = (struct prev_flag_edges *) orig_ex->aux;
++    p->append_cond_position = then_old_edge;
++    p->last_cond_fallthru = find_edge (new_bb, old_dest);
++    orig_ex->aux = (void *) p;
++  }
++
++  if (!loop_has_only_one_exit)
++    for (gsi = gsi_start_phis (old_dest); !gsi_end_p (gsi); gsi_next (&gsi))
++      {
++	gimple phi = gsi_stmt (gsi);
++	unsigned i;
++
++	for (i = 0; i < gimple_phi_num_args (phi); i++)
++	  if (gimple_phi_arg_edge (phi, i)->src == new_bb)
++	    {
++	      tree arg = gimple_phi_arg_def (phi, i);
++	      add_phi_arg (phi, arg, then_old_edge, UNKNOWN_LOCATION);
++	      update_stmt (phi);
++	    }
++      }
++  /* Remove the original fall through edge.  This was the
++     single_succ_edge (new_bb).  */
++  EDGE_SUCC (new_bb, 0)->flags &= ~EDGE_FALLTHRU;
 +}
 +
-+int
-+main ()
++/* Helper function for execute_sm.  On every location where REF is
++   set, set an appropriate flag indicating the store.  */
++
++static tree
++execute_sm_if_changed_flag_set (struct loop *loop, mem_ref_p ref)
 +{
-+  int a[100], i;
-+  for (i = 0; i < 100; i++)
-+    a[i] = i;
-+  if (foo (100, a))
-+    abort ();
-+  return 0;
-+}
-Index: libstdc++-v3/configure
-===================================================================
---- libstdc++-v3/configure	(.../tags/gcc_4_7_0_release)	(wersja 187906)
-+++ libstdc++-v3/configure	(.../branches/gcc-4_7-branch)	(wersja 187906)
-@@ -3025,7 +3025,8 @@
- target_alias=${target_alias-$host_alias}
++  unsigned i;
++  mem_ref_loc_p loc;
++  tree flag;
++  VEC (mem_ref_loc_p, heap) *locs = NULL;
++  char *str = get_lsm_tmp_name (ref->mem, ~0);
++
++  lsm_tmp_name_add ("_flag");
++  flag = make_rename_temp (boolean_type_node, str);
++  get_all_locs_in_loop (loop, ref, &locs);
++  FOR_EACH_VEC_ELT (mem_ref_loc_p, locs, i, loc)
++    {
++      gimple_stmt_iterator gsi;
++      gimple stmt;
++
++      gsi = gsi_for_stmt (loc->stmt);
++      stmt = gimple_build_assign (flag, boolean_true_node);
++      gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
++    }
++  VEC_free (mem_ref_loc_p, heap, locs);
++  return flag;
++}
++
+ /* Executes store motion of memory reference REF from LOOP.
+    Exits from the LOOP are stored in EXITS.  The initialization of the
+    temporary variable is put to the preheader of the loop, and assignments
+@@ -1964,12 +2132,13 @@
+ static void
+ execute_sm (struct loop *loop, VEC (edge, heap) *exits, mem_ref_p ref)
+ {
+-  tree tmp_var;
++  tree tmp_var, store_flag;
+   unsigned i;
+-  gimple load, store;
++  gimple load;
+   struct fmt_data fmt_data;
+-  edge ex;
++  edge ex, latch_edge;
+   struct lim_aux_data *lim_data;
++  bool multi_threaded_model_p = false;
  
- # Handy for debugging:
--#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: $build / $host / $target / $host_alias / $target_alias" >&5
-+$as_echo "$as_me: $build / $host / $target / $host_alias / $target_alias" >&6;}; sleep 5
+   if (dump_file && (dump_flags & TDF_DETAILS))
+     {
+@@ -1985,23 +2154,47 @@
+   fmt_data.orig_loop = loop;
+   for_each_index (&ref->mem, force_move_till, &fmt_data);
+ 
++  if ((flag_tm && block_in_transaction (loop_preheader_edge (loop)->src))
++      || !PARAM_VALUE (PARAM_ALLOW_STORE_DATA_RACES))
++    multi_threaded_model_p = true;
++
++  if (multi_threaded_model_p)
++    store_flag = execute_sm_if_changed_flag_set (loop, ref);
++
+   rewrite_mem_refs (loop, ref, tmp_var);
+ 
+-  /* Emit the load & stores.  */
++  /* Emit the load code into the latch, so that we are sure it will
++     be processed after all dependencies.  */
++  latch_edge = loop_latch_edge (loop);
++
++  /* FIXME/TODO: For the multi-threaded variant, we could avoid this
++     load altogether, since the store is predicated by a flag.  We
++     could, do the load only if it was originally in the loop.  */
+   load = gimple_build_assign (tmp_var, unshare_expr (ref->mem));
+   lim_data = init_lim_data (load);
+   lim_data->max_loop = loop;
+   lim_data->tgt_loop = loop;
++  gsi_insert_on_edge (latch_edge, load);
+ 
+-  /* Put this into the latch, so that we are sure it will be processed after
+-     all dependencies.  */
+-  gsi_insert_on_edge (loop_latch_edge (loop), load);
++  if (multi_threaded_model_p)
++    {
++      load = gimple_build_assign (store_flag, boolean_false_node);
++      lim_data = init_lim_data (load);
++      lim_data->max_loop = loop;
++      lim_data->tgt_loop = loop;
++      gsi_insert_on_edge (latch_edge, load);
++    }
  
- if test "$build" != "$host"; then
-   # We are being configured with some form of cross compiler.
-@@ -11497,7 +11498,7 @@
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 11500 "configure"
-+#line 11501 "configure"
- #include "confdefs.h"
++  /* Sink the store to every exit from the loop.  */
+   FOR_EACH_VEC_ELT (edge, exits, i, ex)
+-    {
+-      store = gimple_build_assign (unshare_expr (ref->mem), tmp_var);
+-      gsi_insert_on_edge (ex, store);
+-    }
++    if (!multi_threaded_model_p)
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/packages/gcc/gcc-branch.diff?r1=1.63&r2=1.64
    http://cvs.pld-linux.org/packages/gcc/gcc.spec?r1=1.693&r2=1.694



More information about the pld-cvs-commit mailing list