cc/gcc: add gcc-4.7.0
author"Bryan Hundven" <bryanhundven@gmail.com>
Fri Mar 23 01:36:42 2012 -0700 (2012-03-23)
changeset 2943ededa826097f
parent 2942 407d9e4c7b0b
child 2944 8bddd94e068b
cc/gcc: add gcc-4.7.0

Add the new release gcc-4.7.0.

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
[yann.morin.1998@free.fr: add 4.7.0 patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
config/cc/gcc.in
patches/gcc/4.7.0/100-PR52734-tree-ssa-tail-merge.patch
     1.1 --- a/config/cc/gcc.in	Mon Apr 16 15:29:06 2012 +0200
     1.2 +++ b/config/cc/gcc.in	Fri Mar 23 01:36:42 2012 -0700
     1.3 @@ -36,6 +36,12 @@
     1.4  # Don't remove next line
     1.5  # CT_INSERT_VERSION_BELOW
     1.6  
     1.7 +config CC_V_4_7_0
     1.8 +    bool
     1.9 +    prompt "4.7.0 (EXPERIMENTAL)"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    select CC_GCC_4_7
    1.12 +
    1.13  config CC_V_linaro_4_6_2012_04
    1.14      bool
    1.15      prompt "linaro-4.6-2012.04 (EXPERIMENTAL)"
    1.16 @@ -269,6 +275,20 @@
    1.17      bool
    1.18      select CC_GCC_4_5_or_later
    1.19  
    1.20 +config CC_GCC_4_7
    1.21 +    bool
    1.22 +    select CC_GCC_4_7_or_later
    1.23 +    select CC_GCC_USE_GMP_MPFR
    1.24 +    select CC_GCC_USE_MPC
    1.25 +    select CC_GCC_HAS_GRAPHITE
    1.26 +    select CC_GCC_HAS_LTO
    1.27 +    select CC_GCC_HAS_PKGVERSION_BUGURL
    1.28 +    select CC_GCC_HAS_BUILD_ID
    1.29 +
    1.30 +config CC_GCC_4_7_or_later
    1.31 +    bool
    1.32 +    select CC_GCC_4_6_or_later
    1.33 +
    1.34  config CC_GCC_HAS_GRAPHITE
    1.35      bool
    1.36  
    1.37 @@ -331,6 +351,7 @@
    1.38      string
    1.39  # Don't remove next line
    1.40  # CT_INSERT_VERSION_STRING_BELOW
    1.41 +    default "4.7.0" if CC_V_4_7_0
    1.42      default "linaro-4.6-2012.04" if CC_V_linaro_4_6_2012_04
    1.43      default "4.6.3" if CC_V_4_6_3
    1.44      default "4.6.2" if CC_V_4_6_2
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/gcc/4.7.0/100-PR52734-tree-ssa-tail-merge.patch	Fri Mar 23 01:36:42 2012 -0700
     2.3 @@ -0,0 +1,91 @@
     2.4 +------------------------------------------------------------------------
     2.5 +r186424 | vries | 2012-04-13 18:44:18 +0200 (Fri, 13 Apr 2012) | 12 lines
     2.6 +
     2.7 +2012-04-13  Tom de Vries  <tom@codesourcery.com>
     2.8 +
     2.9 +	Backport from mainline r186418.
    2.10 +
    2.11 +	2012-04-13  Tom de Vries  <tom@codesourcery.com>
    2.12 +
    2.13 +	* tree-ssa-tail-merge.c (gsi_advance_bw_nondebug_nonlocal): Add
    2.14 +	parameters vuse and vuse_escaped.
    2.15 +	(find_duplicate): Init vuse1, vuse2 and vuse_escaped.  Pass to
    2.16 +	gsi_advance_bw_nondebug_nonlocal.  Return if vuse_escaped and
    2.17 +	vuse1 != vuse2.
    2.18 +
    2.19 +------------------------------------------------------------------------
    2.20 +Index: gcc/tree-ssa-tail-merge.c
    2.21 +===================================================================
    2.22 +--- gcc-4.7.0/gcc/tree-ssa-tail-merge.c	(revision 186423)
    2.23 ++++ gcc-4.7.0/gcc/tree-ssa-tail-merge.c	(revision 186424)
    2.24 +@@ -1123,18 +1123,31 @@
    2.25 +     }
    2.26 + }
    2.27 + 
    2.28 +-/* Let GSI skip backwards over local defs.  */
    2.29 ++/* Let GSI skip backwards over local defs.  Return the earliest vuse in VUSE.
    2.30 ++   Return true in VUSE_ESCAPED if the vuse influenced a SSA_OP_DEF of one of the
    2.31 ++   processed statements.  */
    2.32 + 
    2.33 + static void
    2.34 +-gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi)
    2.35 ++gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi, tree *vuse,
    2.36 ++				  bool *vuse_escaped)
    2.37 + {
    2.38 +   gimple stmt;
    2.39 ++  tree lvuse;
    2.40 + 
    2.41 +   while (true)
    2.42 +     {
    2.43 +       if (gsi_end_p (*gsi))
    2.44 + 	return;
    2.45 +       stmt = gsi_stmt (*gsi);
    2.46 ++
    2.47 ++      lvuse = gimple_vuse (stmt);
    2.48 ++      if (lvuse != NULL_TREE)
    2.49 ++	{
    2.50 ++	  *vuse = lvuse;
    2.51 ++	  if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_DEF))
    2.52 ++	    *vuse_escaped = true;
    2.53 ++	}
    2.54 ++
    2.55 +       if (!(is_gimple_assign (stmt) && local_def (gimple_get_lhs (stmt))
    2.56 + 	    && !gimple_has_side_effects (stmt)))
    2.57 + 	return;
    2.58 +@@ -1150,9 +1163,11 @@
    2.59 + {
    2.60 +   gimple_stmt_iterator gsi1 = gsi_last_nondebug_bb (bb1);
    2.61 +   gimple_stmt_iterator gsi2 = gsi_last_nondebug_bb (bb2);
    2.62 ++  tree vuse1 = NULL_TREE, vuse2 = NULL_TREE;
    2.63 ++  bool vuse_escaped = false;
    2.64 + 
    2.65 +-  gsi_advance_bw_nondebug_nonlocal (&gsi1);
    2.66 +-  gsi_advance_bw_nondebug_nonlocal (&gsi2);
    2.67 ++  gsi_advance_bw_nondebug_nonlocal (&gsi1, &vuse1, &vuse_escaped);
    2.68 ++  gsi_advance_bw_nondebug_nonlocal (&gsi2, &vuse2, &vuse_escaped);
    2.69 + 
    2.70 +   while (!gsi_end_p (gsi1) && !gsi_end_p (gsi2))
    2.71 +     {
    2.72 +@@ -1161,13 +1176,20 @@
    2.73 + 
    2.74 +       gsi_prev_nondebug (&gsi1);
    2.75 +       gsi_prev_nondebug (&gsi2);
    2.76 +-      gsi_advance_bw_nondebug_nonlocal (&gsi1);
    2.77 +-      gsi_advance_bw_nondebug_nonlocal (&gsi2);
    2.78 ++      gsi_advance_bw_nondebug_nonlocal (&gsi1, &vuse1, &vuse_escaped);
    2.79 ++      gsi_advance_bw_nondebug_nonlocal (&gsi2, &vuse2, &vuse_escaped);
    2.80 +     }
    2.81 + 
    2.82 +   if (!(gsi_end_p (gsi1) && gsi_end_p (gsi2)))
    2.83 +     return;
    2.84 + 
    2.85 ++  /* If the incoming vuses are not the same, and the vuse escaped into an
    2.86 ++     SSA_OP_DEF, then merging the 2 blocks will change the value of the def,
    2.87 ++     which potentially means the semantics of one of the blocks will be changed.
    2.88 ++     TODO: make this check more precise.  */
    2.89 ++  if (vuse_escaped && vuse1 != vuse2)
    2.90 ++    return;
    2.91 ++
    2.92 +   if (dump_file)
    2.93 +     fprintf (dump_file, "find_duplicates: <bb %d> duplicate of <bb %d>\n",
    2.94 + 	     bb1->index, bb2->index);