[r26]: gcc-4.4.2.patch Maximize Restore History

Download this file

gcc-4.4.2.patch    135 lines (124 with data), 4.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
diff -urN gcc-4.4.2-orig/configure gcc-4.4.2-new/configure
--- gcc-4.4.2-orig/configure 2009-04-25 00:10:29.000000000 -0400
+++ gcc-4.4.2-new/configure 2009-10-25 07:30:29.000000000 -0400
@@ -2360,6 +2360,9 @@
avr-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
;;
+ msp430-*-*)
+ noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
+ ;;
bfin-*-*)
noconfigdirs="$noconfigdirs gdb"
if test x${is_cross_compiler} != xno ; then
diff -urN gcc-4.4.2-orig/gcc/config.gcc gcc-4.4.2-new/gcc/config.gcc
--- gcc-4.4.2-orig/gcc/config.gcc 2009-09-13 09:01:13.000000000 -0400
+++ gcc-4.4.2-new/gcc/config.gcc 2009-10-25 07:30:29.000000000 -0400
@@ -804,6 +804,12 @@
avr-*-*)
tm_file="avr/avr.h dbxelf.h"
;;
+msp430-*-*)
+ tm_file="msp430/msp430.h dbxelf.h"
+ c_target_objs=`cat ${srcdir}/config/msp430/objs-extra`
+ cxx_target_objs=`cat ${srcdir}/config/msp430/objs-extra`
+ use_fixproto=yes
+ ;;
bfin*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
tmake_file=bfin/t-bfin-elf
diff -urN gcc-4.4.2-orig/gcc/configure gcc-4.4.2-new/gcc/configure
--- gcc-4.4.2-orig/gcc/configure 2009-03-24 13:46:03.000000000 -0400
+++ gcc-4.4.2-new/gcc/configure 2009-10-25 07:30:29.000000000 -0400
@@ -1595,6 +1595,7 @@
gcc_version=`cat $srcdir/BASE-VER`
+echo $gcc_version | sed s/\\\([0-9]\\\)\.\\\([0-9]\\\)\.\\\([0-9]\\\)/\#define\ GCC_VERSION_INT\ 0x\\1\\2\\3/g > $srcdir/_gccver.h
# Determine the host, build, and target systems
ac_aux_dir=
diff -urN gcc-4.4.2-orig/gcc/loop-invariant.c gcc-4.4.2-new/gcc/loop-invariant.c
--- gcc-4.4.2-orig/gcc/loop-invariant.c 2009-02-20 07:56:01.000000000 -0500
+++ gcc-4.4.2-new/gcc/loop-invariant.c 2009-10-25 07:30:29.000000000 -0400
@@ -1171,11 +1171,13 @@
rtx reg, set, dest, note;
struct use *use;
bitmap_iterator bi;
+ int n_validated;
if (inv->reg)
return true;
if (!repr->move)
return false;
+ n_validated = num_validated_changes ();
/* If this is a representative of the class of equivalent invariants,
really move the invariant. Otherwise just replace its use with
the register used for the representative. */
@@ -1200,7 +1202,17 @@
reg = gen_reg_rtx_and_attrs (dest);
/* Try replacing the destination by a new pseudoregister. */
- if (!validate_change (inv->insn, &SET_DEST (set), reg, false))
+ validate_change (inv->insn, &SET_DEST (set), reg, true);
+
+ /* Replace the uses we know to be dominated. It saves work for copy
+ propagation, and also it is necessary so that dependent invariants
+ are computed right. */
+ /* Note that we must test the changes for validity, lest we might
+ rip apart a match_dup between a use and a clobber. */
+ if (inv->def)
+ for (use = inv->def->uses; use; use = use->next)
+ validate_change (use->insn, use->pos, reg, true);
+ if (!apply_change_group ())
goto fail;
df_insn_rescan (inv->insn);
@@ -1219,9 +1231,23 @@
}
else
{
- if (!move_invariant_reg (loop, repr->invno))
- goto fail;
+ /* Replace the uses we know to be dominated. It saves work for copy
+ propagation, and also it is necessary so that dependent invariants
+ are computed right. */
reg = repr->reg;
+ if (inv->def)
+ for (use = inv->def->uses; use; use = use->next)
+ validate_change (use->insn, use->pos, reg, true);
+
+ if (verify_changes (n_validated)
+ && move_invariant_reg (loop, repr->invno))
+ confirm_change_group ();
+ else
+ {
+ cancel_changes (n_validated);
+ goto fail;
+ }
+
set = single_set (inv->insn);
emit_insn_after (gen_move_insn (SET_DEST (set), reg), inv->insn);
delete_insn (inv->insn);
@@ -1230,17 +1256,9 @@
inv->reg = reg;
- /* Replace the uses we know to be dominated. It saves work for copy
- propagation, and also it is necessary so that dependent invariants
- are computed right. */
if (inv->def)
- {
- for (use = inv->def->uses; use; use = use->next)
- {
- *use->pos = reg;
- df_insn_rescan (use->insn);
- }
- }
+ for (use = inv->def->uses; use; use = use->next)
+ df_insn_rescan (use->insn);
return true;
diff -urN gcc-4.4.2-orig/libgcc/config.host gcc-4.4.2-new/libgcc/config.host
--- gcc-4.4.2-orig/libgcc/config.host 2009-04-17 07:58:41.000000000 -0400
+++ gcc-4.4.2-new/libgcc/config.host 2009-10-25 07:30:29.000000000 -0400
@@ -224,6 +224,8 @@
# Make HImode functions for AVR
tmake_file=${cpu_type}/t-avr
;;
+msp430-*-*)
+ ;;
bfin*-elf*)
;;
bfin*-uclinux*)