aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wehle <john@feith.com>2001-04-13 04:10:56 +0000
committerJohn Wehle <wehle@gcc.gnu.org>2001-04-13 04:10:56 +0000
commit35bb0780fcaf96e18159da57c2d77393d1aeb7eb (patch)
tree6c074d7a000673d864424a17e5abaabb72a7bdce
parent1a5428f737b19b58f505bec4e774ff93df40683d (diff)
downloadgcc-35bb0780fcaf96e18159da57c2d77393d1aeb7eb.zip
gcc-35bb0780fcaf96e18159da57c2d77393d1aeb7eb.tar.gz
gcc-35bb0780fcaf96e18159da57c2d77393d1aeb7eb.tar.bz2
jump.c (jump_optimize_1): Don't delete dead stores here.
* jump.c (jump_optimize_1): Don't delete dead stores here. * toplev.c (rest_of_compilation): Call delete_trivially_dead_insns prior to running jump optimize before cse2. From-SVN: r41320
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/jump.c29
-rw-r--r--gcc/toplev.c6
3 files changed, 12 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f079d10..4f431b6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Fri Apr 13 00:09:22 EDT 2001 John Wehle (john@feith.com)
+
+ * jump.c (jump_optimize_1): Don't delete dead stores here.
+ * toplev.c (rest_of_compilation): Call delete_trivially_dead_insns
+ prior to running jump optimize before cse2.
+
2001-04-12 Stan Shebs <shebs@apple.com>
* objc/objc-act.c: Remove all code ifdefed with the never-used
diff --git a/gcc/jump.c b/gcc/jump.c
index 6bd6edd..e4a7cf82 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -248,35 +248,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
if (noop_moves)
delete_noop_moves (f);
- /* If we haven't yet gotten to reload and we have just run regscan,
- delete any insn that sets a register that isn't used elsewhere.
- This helps some of the optimizations below by having less insns
- being jumped around. */
-
- if (optimize && ! reload_completed && after_regscan)
- for (insn = f; insn; insn = next)
- {
- rtx set = single_set (insn);
-
- next = NEXT_INSN (insn);
-
- if (set && GET_CODE (SET_DEST (set)) == REG
- && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER
- && REGNO_FIRST_UID (REGNO (SET_DEST (set))) == INSN_UID (insn)
- /* We use regno_last_note_uid so as not to delete the setting
- of a reg that's used in notes. A subsequent optimization
- might arrange to use that reg for real. */
- && REGNO_LAST_NOTE_UID (REGNO (SET_DEST (set))) == INSN_UID (insn)
- && ! side_effects_p (SET_SRC (set))
- && ! find_reg_note (insn, REG_RETVAL, 0)
- /* An ADDRESSOF expression can turn into a use of the internal arg
- pointer, so do not delete the initialization of the internal
- arg pointer yet. If it is truly dead, flow will delete the
- initializing insn. */
- && SET_DEST (set) != current_function_internal_arg_pointer)
- delete_insn (insn);
- }
-
/* Now iterate optimizing jumps until nothing changes over one pass. */
changed = 1;
old_max_reg = max_reg_num ();
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 043c0b6..ae4de0e 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -3224,6 +3224,12 @@ rest_of_compilation (decl)
??? Rework to not call reg_scan so often. */
timevar_push (TV_JUMP);
+ /* The previous call to loop_optimize makes some instructions
+ trivially dead. We delete those instructions now in the
+ hope that doing so will make the heuristics in jump work
+ better and possibly speed up compilation. */
+ delete_trivially_dead_insns (insns, max_reg_num ());
+
reg_scan (insns, max_reg_num (), 0);
jump_optimize (insns, !JUMP_CROSS_JUMP,
!JUMP_NOOP_MOVES, JUMP_AFTER_REGSCAN);