Commit b4a8ae3e authored by Gustavo Zacarias's avatar Gustavo Zacarias Committed by Peter Korsgaard
Browse files

toolchain/gcc: add 4.7.x series



Add gcc 4.7.0 to the toolchain options.

[Peter: drop 0001-toolchain-gcc-add-4.7.x-series.txt]
Signed-off-by: default avatarGustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent f4f4172a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ config BR2_ARM_EABI
	bool "EABI"
config BR2_ARM_OABI
	bool "OABI"
	depends on !BR2_GCC_VERSION_4_7_X
endchoice

choice
+33 −0
Original line number Diff line number Diff line
--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
+++ gcc/contrib/regression/objs-gcc.sh
@@ -105,6 +105,10 @@
  then
   make all-gdb all-dejagnu all-ld || exit 1
   make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
+ then
+  make all-gdb all-dejagnu all-ld || exit 1
+  make install-gdb install-dejagnu install-ld || exit 1
 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
   make bootstrap || exit 1
   make install || exit 1
--- gcc/libjava/classpath/ltconfig
+++ gcc/libjava/classpath/ltconfig
@@ -603,7 +603,7 @@
 
 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
 case $host_os in
-linux-gnu*) ;;
+linux-gnu*|linux-uclibc*) ;;
 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
 esac
 
@@ -1251,7 +1251,7 @@
   ;;
 
 # This must be Linux ELF.
-linux-gnu*)
+linux*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
+115 −0
Original line number Diff line number Diff line
Index: gcc/tree-ssa-tail-merge.c
===================================================================
--- a/gcc/tree-ssa-tail-merge.c (revision 185028)
+++ b/gcc/tree-ssa-tail-merge.c (working copy)
@@ -1123,18 +1123,31 @@ gimple_equal_p (same_succ same_succ, gim
     }
 }
 
-/* Let GSI skip backwards over local defs.  */
+/* Let GSI skip backwards over local defs.  Return the earliest vuse in VUSE.
+   Return true in VUSE_ESCAPED if the vuse influenced a SSA_OP_DEF of one of the
+   processed statements.  */
 
 static void
-gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi)
+gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi, tree *vuse,
+				  bool *vuse_escaped)
 {
   gimple stmt;
+  tree lvuse;
 
   while (true)
     {
       if (gsi_end_p (*gsi))
 	return;
       stmt = gsi_stmt (*gsi);
+
+      lvuse = gimple_vuse (stmt);
+      if (lvuse != NULL_TREE)
+	{
+	  *vuse = lvuse;
+	  if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_DEF))
+	    *vuse_escaped = true;
+	}
+
       if (!(is_gimple_assign (stmt) && local_def (gimple_get_lhs (stmt))
 	    && !gimple_has_side_effects (stmt)))
 	return;
@@ -1150,9 +1163,11 @@ find_duplicate (same_succ same_succ, bas
 {
   gimple_stmt_iterator gsi1 = gsi_last_nondebug_bb (bb1);
   gimple_stmt_iterator gsi2 = gsi_last_nondebug_bb (bb2);
+  tree vuse1 = NULL_TREE, vuse2 = NULL_TREE;
+  bool vuse_escaped = false;
 
-  gsi_advance_bw_nondebug_nonlocal (&gsi1);
-  gsi_advance_bw_nondebug_nonlocal (&gsi2);
+  gsi_advance_bw_nondebug_nonlocal (&gsi1, &vuse1, &vuse_escaped);
+  gsi_advance_bw_nondebug_nonlocal (&gsi2, &vuse2, &vuse_escaped);
 
   while (!gsi_end_p (gsi1) && !gsi_end_p (gsi2))
     {
@@ -1161,13 +1176,20 @@ find_duplicate (same_succ same_succ, bas
 
       gsi_prev_nondebug (&gsi1);
       gsi_prev_nondebug (&gsi2);
-      gsi_advance_bw_nondebug_nonlocal (&gsi1);
-      gsi_advance_bw_nondebug_nonlocal (&gsi2);
+      gsi_advance_bw_nondebug_nonlocal (&gsi1, &vuse1, &vuse_escaped);
+      gsi_advance_bw_nondebug_nonlocal (&gsi2, &vuse2, &vuse_escaped);
     }
 
   if (!(gsi_end_p (gsi1) && gsi_end_p (gsi2)))
     return;
 
+  /* If the incoming vuses are not the same, and the vuse escaped into an
+     SSA_OP_DEF, then merging the 2 blocks will change the value of the def,
+     which potentially means the semantics of one of the blocks will be changed.
+     TODO: make this check more precise.  */
+  if (vuse_escaped && vuse1 != vuse2)
+    return;
+
   if (dump_file)
     fprintf (dump_file, "find_duplicates: <bb %d> duplicate of <bb %d>\n",
 	     bb1->index, bb2->index);
Index: gcc/testsuite/gcc.dg/pr52734.c
===================================================================
--- a/dev/null (new file)
+++ b/gcc/testsuite/gcc.dg/pr52734.c (revision 0)
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int bbb = 0;
+
+int __attribute__((noinline,noclone)) aaa(void)
+{
+    ++bbb;
+    return 0;
+}
+
+int __attribute__((noinline,noclone)) ccc(void)
+{
+  int ddd;
+  /* bbb == 0 */
+  if (aaa())
+    return bbb;
+
+  /* bbb == 1 */
+  ddd = bbb;
+  /* bbb == ddd == 1 */
+  if (aaa ())
+    return 0;
+  /* bbb == 2, ddd == 1 */
+
+  return ddd;
+}
+
+int main(void)
+{
+    if (ccc() != 1)
+	__builtin_abort();
+    return 0;
+}
+
+11 −0
Original line number Diff line number Diff line
--- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
+++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
@@ -500,7 +500,7 @@
 #ifdef __linux__
 # include <features.h>
 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
-     && !defined(__ia64__)
+     && !defined(__ia64__) && !defined(__UCLIBC__)
 #   ifndef GC_HAVE_BUILTIN_BACKTRACE
 #     define GC_HAVE_BUILTIN_BACKTRACE
 #   endif
+13 −0
Original line number Diff line number Diff line
Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
===================================================================
--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio	(revision 129202)
+++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio	(working copy)
@@ -144,7 +144,7 @@
 
 _GLIBCXX_END_NAMESPACE
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99 || defined __UCLIBC__
 
 #undef snprintf
 #undef vfscanf
Loading