diff options
Diffstat (limited to 'meta/packages/gcc/gcc-4.1.1/cse.patch')
-rw-r--r-- | meta/packages/gcc/gcc-4.1.1/cse.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-4.1.1/cse.patch b/meta/packages/gcc/gcc-4.1.1/cse.patch new file mode 100644 index 0000000000..88b22c714f --- /dev/null +++ b/meta/packages/gcc/gcc-4.1.1/cse.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | -- gcc-4_1-branch/gcc/cse.c 2006/07/20 14:20:26 115619 | ||
2 | +++ gcc-4_1-branch/gcc/cse.c 2006/07/20 15:07:25 115620 | ||
3 | @@ -4697,6 +4697,8 @@ | ||
4 | unsigned src_const_hash; | ||
5 | /* Table entry for constant equivalent for SET_SRC, if any. */ | ||
6 | struct table_elt *src_const_elt; | ||
7 | + /* Table entry for the destination address. */ | ||
8 | + struct table_elt *dest_addr_elt; | ||
9 | }; | ||
10 | |||
11 | static void | ||
12 | @@ -5936,6 +5938,40 @@ | ||
13 | so that the destination goes into that class. */ | ||
14 | sets[i].src_elt = src_eqv_elt; | ||
15 | |||
16 | + /* Record destination addresses in the hash table. This allows us to | ||
17 | + check if they are invalidated by other sets. */ | ||
18 | + for (i = 0; i < n_sets; i++) | ||
19 | + { | ||
20 | + if (sets[i].rtl) | ||
21 | + { | ||
22 | + rtx x = sets[i].inner_dest; | ||
23 | + struct table_elt *elt; | ||
24 | + enum machine_mode mode; | ||
25 | + unsigned hash; | ||
26 | + | ||
27 | + if (MEM_P (x)) | ||
28 | + { | ||
29 | + x = XEXP (x, 0); | ||
30 | + mode = GET_MODE (x); | ||
31 | + hash = HASH (x, mode); | ||
32 | + elt = lookup (x, hash, mode); | ||
33 | + if (!elt) | ||
34 | + { | ||
35 | + if (insert_regs (x, NULL, 0)) | ||
36 | + { | ||
37 | + rehash_using_reg (x); | ||
38 | + hash = HASH (x, mode); | ||
39 | + } | ||
40 | + elt = insert (x, NULL, hash, mode); | ||
41 | + } | ||
42 | + | ||
43 | + sets[i].dest_addr_elt = elt; | ||
44 | + } | ||
45 | + else | ||
46 | + sets[i].dest_addr_elt = NULL; | ||
47 | + } | ||
48 | + } | ||
49 | + | ||
50 | invalidate_from_clobbers (x); | ||
51 | |||
52 | /* Some registers are invalidated by subroutine calls. Memory is | ||
53 | @@ -6028,12 +6064,20 @@ | ||
54 | } | ||
55 | |||
56 | /* We may have just removed some of the src_elt's from the hash table. | ||
57 | - So replace each one with the current head of the same class. */ | ||
58 | + So replace each one with the current head of the same class. | ||
59 | + Also check if destination addresses have been removed. */ | ||
60 | |||
61 | for (i = 0; i < n_sets; i++) | ||
62 | if (sets[i].rtl) | ||
63 | { | ||
64 | - if (sets[i].src_elt && sets[i].src_elt->first_same_value == 0) | ||
65 | + if (sets[i].dest_addr_elt | ||
66 | + && sets[i].dest_addr_elt->first_same_value == 0) | ||
67 | + { | ||
68 | + /* The elt was removed, which means this destination s not | ||
69 | + valid after this instruction. */ | ||
70 | + sets[i].rtl = NULL_RTX; | ||
71 | + } | ||
72 | + else if (sets[i].src_elt && sets[i].src_elt->first_same_value == 0) | ||
73 | /* If elt was removed, find current head of same class, | ||
74 | or 0 if nothing remains of that class. */ | ||
75 | { | ||