Contents of /trunk/gcc/patches/gcc-4.9-tree-ssa-threadedge.patch
Parent Directory | Revision Log
Revision 2434 -
(show annotations)
(download)
Tue May 13 11:12:43 2014 UTC (10 years, 4 months ago) by niro
File size: 1475 byte(s)
Tue May 13 11:12:43 2014 UTC (10 years, 4 months ago) by niro
File size: 1475 byte(s)
-added some fixes for gcc-4.9
1 | --- trunk/gcc/tree-ssa-threadedge.c 2014/04/23 17:53:56 209715 |
2 | +++ trunk/gcc/tree-ssa-threadedge.c 2014/04/23 18:04:46 209716 |
3 | @@ -387,7 +387,34 @@ |
4 | && (gimple_code (stmt) != GIMPLE_CALL |
5 | || gimple_call_lhs (stmt) == NULL_TREE |
6 | || TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)) |
7 | - continue; |
8 | + { |
9 | + /* STMT might still have DEFS and we need to invalidate any known |
10 | + equivalences for them. |
11 | + |
12 | + Consider if STMT is a GIMPLE_ASM with one or more outputs that |
13 | + feeds a conditional inside a loop. We might derive an equivalence |
14 | + due to the conditional. */ |
15 | + tree op; |
16 | + ssa_op_iter iter; |
17 | + |
18 | + if (backedge_seen) |
19 | + FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF) |
20 | + { |
21 | + /* This call only invalidates equivalences created by |
22 | + PHI nodes. This is by design to keep the cost of |
23 | + of invalidation reasonable. */ |
24 | + invalidate_equivalences (op, stack, src_map, dst_map); |
25 | + |
26 | + /* However, conditionals can imply values for real |
27 | + operands as well. And those won't be recorded in the |
28 | + maps. In fact, those equivalences may be recorded totally |
29 | + outside the threading code. We can just create a new |
30 | + temporary NULL equivalence here. */ |
31 | + record_temporary_equivalence (op, NULL_TREE, stack); |
32 | + } |
33 | + |
34 | + continue; |
35 | + } |
36 | |
37 | /* The result of __builtin_object_size depends on all the arguments |
38 | of a phi node. Temporarily using only one edge produces invalid |