]> git.pld-linux.org Git - packages/gcc.git/blame - gcc-pr25248.patch
This commit was manufactured by cvs2git to create branch 'GCC_4_1'.
[packages/gcc.git] / gcc-pr25248.patch
CommitLineData
82a0d200
PS
1Date: Tue, 6 Dec 2005 21:31:58 +0100
2From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
3Subject: [patch] for PR 25248
4
5Hello,
6
7when follow_ssa_edge_in_rhs analyzes expression of form a + b, it first
8tries to analyze a, and if it fails, analyzes b. The results are
9accumulated to evolution_of_loop. However, the failed attempt to analyze 'a' may
10modify contents of evolution_of_loop; the result of analysis of 'b' is
11then combined with it, which produces a wrong result. Fixed by using a
12temporary variable to store the result in the analysis of 'a'.
13
14Bootstrapped & regtested on i686 and ppc64.
15
16Zdenek
17
18 PR tree-optimization/25248
19 * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Do not use
20 evolution_of_loop from the failed attempt.
21
22Index: tree-scalar-evolution.c
23===================================================================
24*** gcc/gcc/tree-scalar-evolution.c (revision 108078)
25--- gcc/gcc/tree-scalar-evolution.c (working copy)
26*************** follow_ssa_edge_in_rhs (struct loop *loo
27*** 1042,1047 ****
28--- 1042,1048 ----
29 t_bool res = t_false;
30 tree rhs0, rhs1;
31 tree type_rhs = TREE_TYPE (rhs);
32+ tree evol;
33
34 /* The RHS is one of the following cases:
35 - an SSA_NAME,
36*************** follow_ssa_edge_in_rhs (struct loop *loo
37*** 1084,1097 ****
38 {
39 /* Match an assignment under the form:
40 "a = b + c". */
41 res = follow_ssa_edge
42 (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
43! evolution_of_loop, limit);
44
45 if (res == t_true)
46 *evolution_of_loop = add_to_evolution
47 (loop->num,
48! chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
49 PLUS_EXPR, rhs1);
50
51 else if (res == t_false)
52--- 1085,1099 ----
53 {
54 /* Match an assignment under the form:
55 "a = b + c". */
56+ evol = *evolution_of_loop;
57 res = follow_ssa_edge
58 (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
59! &evol, limit);
60
61 if (res == t_true)
62 *evolution_of_loop = add_to_evolution
63 (loop->num,
64! chrec_convert (type_rhs, evol, at_stmt),
65 PLUS_EXPR, rhs1);
66
67 else if (res == t_false)
This page took 0.113892 seconds and 4 git commands to generate.