| [617118d] | 1 | Submitted By: Ryan Oliver <ryan.oliver@pha.com.au> | 
|---|
|  | 2 | Source: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21173 | 
|---|
|  | 3 | Initial Package Version: 4.0.0 | 
|---|
|  | 4 | Upstrean Status: In Gcc4 Mainline | 
|---|
|  | 5 | Description: | 
|---|
|  | 6 |  | 
|---|
|  | 7 | 2005-04-25  Daniel Berlin  <dberlin@dberlin.org> | 
|---|
|  | 8 |  | 
|---|
|  | 9 | Fix PR tree-optimization/21173 | 
|---|
|  | 10 |  | 
|---|
|  | 11 | * tree-ssa-pre.c (create_expression_by_pieces): Call unshare_expr | 
|---|
|  | 12 | on things we pass to force_gimple_operand.  Don't try to special | 
|---|
|  | 13 | case min_invariants. | 
|---|
|  | 14 |  | 
|---|
|  | 15 | =================================================================== | 
|---|
|  | 16 | RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v | 
|---|
|  | 17 | retrieving revision 2.65.4.2 | 
|---|
|  | 18 | retrieving revision 2.65.4.3 | 
|---|
|  | 19 | diff -u -r2.65.4.2 -r2.65.4.3 | 
|---|
|  | 20 | --- gcc/gcc/tree-ssa-pre.c      2005/04/17 23:40:31     2.65.4.2 | 
|---|
|  | 21 | +++ gcc/gcc/tree-ssa-pre.c      2005/04/25 14:02:31     2.65.4.3 | 
|---|
|  | 22 | @@ -1330,7 +1330,8 @@ | 
|---|
|  | 23 |  | 
|---|
|  | 24 | folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), | 
|---|
|  | 25 | genop1, genop2)); | 
|---|
|  | 26 | -       newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL); | 
|---|
|  | 27 | +       newexpr = force_gimple_operand (unshare_expr (folded), | 
|---|
|  | 28 | +                                       &forced_stmts, false, NULL); | 
|---|
|  | 29 | if (forced_stmts) | 
|---|
|  | 30 | { | 
|---|
|  | 31 | tsi = tsi_start (forced_stmts); | 
|---|
|  | 32 | @@ -1372,14 +1373,8 @@ | 
|---|
|  | 33 | add_referenced_tmp_var (temp); | 
|---|
|  | 34 | folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), | 
|---|
|  | 35 | genop1)); | 
|---|
|  | 36 | -       /* If the generated operand  is already GIMPLE min_invariant | 
|---|
|  | 37 | -          just use it instead of calling force_gimple_operand on it, | 
|---|
|  | 38 | -          since that may make it not invariant by copying it into an | 
|---|
|  | 39 | -          assignment.  */ | 
|---|
|  | 40 | -       if (!is_gimple_min_invariant (genop1)) | 
|---|
|  | 41 | -         newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL); | 
|---|
|  | 42 | -       else | 
|---|
|  | 43 | -         newexpr = genop1; | 
|---|
|  | 44 | +       newexpr = force_gimple_operand (unshare_expr (folded), | 
|---|
|  | 45 | +                                       &forced_stmts, false, NULL); | 
|---|
|  | 46 | if (forced_stmts) | 
|---|
|  | 47 | { | 
|---|
|  | 48 | tsi = tsi_start (forced_stmts); | 
|---|