patches/gcc/4.0.0/pr21173-fix.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.0.0/pr21173-fix.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,66 @@
     1.4 +See http://gcc.gnu.org/PR21173
     1.5 +This is a fix for a last minute brown-bag bug with gcc-4.0.0
     1.6 +
     1.7 + ------- Additional Comment #24 From CVS Commits 2005-04-25 14:03 [reply] ------- 
     1.8 +Subject: Bug 21173
     1.9 +
    1.10 +CVSROOT:        /cvs/gcc
    1.11 +Module name:    gcc
    1.12 +Branch:         gcc-4_0-branch
    1.13 +Changes by:     dberlin@gcc.gnu.org     2005-04-25 14:02:38
    1.14 +
    1.15 +Modified files:
    1.16 +        gcc            : ChangeLog tree-ssa-pre.c 
    1.17 +
    1.18 +Log message:
    1.19 +        2005-04-25  Daniel Berlin  <dberlin@dberlin.org>
    1.20 +        
    1.21 +        Fix PR tree-optimization/21173
    1.22 +        
    1.23 +        * tree-ssa-pre.c (create_expression_by_pieces): Call unshare_expr
    1.24 +        on things we pass to force_gimple_operand.  Don't try to special
    1.25 +        case min_invariants.
    1.26 +
    1.27 +Patches:
    1.28 +http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.192&r2=2.7592.2.193
    1.29 +http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-pre.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.65.4.2&r2=2.65.4.3
    1.30 +
    1.31 +===================================================================
    1.32 +RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
    1.33 +retrieving revision 2.65.4.2
    1.34 +retrieving revision 2.65.4.3
    1.35 +diff -u -r2.65.4.2 -r2.65.4.3
    1.36 +--- gcc/gcc/tree-ssa-pre.c	2005/04/17 23:40:31	2.65.4.2
    1.37 ++++ gcc/gcc/tree-ssa-pre.c	2005/04/25 14:02:31	2.65.4.3
    1.38 +@@ -1330,7 +1330,8 @@
    1.39 + 	
    1.40 + 	folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), 
    1.41 + 			      genop1, genop2));
    1.42 +-	newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL);
    1.43 ++	newexpr = force_gimple_operand (unshare_expr (folded), 
    1.44 ++					&forced_stmts, false, NULL);
    1.45 + 	if (forced_stmts)
    1.46 + 	  {
    1.47 + 	    tsi = tsi_start (forced_stmts);
    1.48 +@@ -1372,14 +1373,8 @@
    1.49 + 	add_referenced_tmp_var (temp);
    1.50 + 	folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), 
    1.51 + 			      genop1));
    1.52 +-	/* If the generated operand  is already GIMPLE min_invariant
    1.53 +-	   just use it instead of calling force_gimple_operand on it,
    1.54 +-	   since that may make it not invariant by copying it into an
    1.55 +-	   assignment.  */
    1.56 +-	if (!is_gimple_min_invariant (genop1))
    1.57 +-	  newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL);
    1.58 +-	else
    1.59 +-	  newexpr = genop1;
    1.60 ++	newexpr = force_gimple_operand (unshare_expr (folded), 
    1.61 ++					&forced_stmts, false, NULL);
    1.62 + 	if (forced_stmts)
    1.63 + 	  {
    1.64 + 	    tsi = tsi_start (forced_stmts);
    1.65 +
    1.66 +    0K .                                                         1.24 MB/s
    1.67 +
    1.68 +13:16:54 (1.24 MB/s) - `-' saved [1303]
    1.69 +