summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-09-07 07:45:42 +0000
committerJeff Law <law@gcc.gnu.org>1999-09-07 01:45:42 -0600
commita0f9fdb29b7aebb07fc58960c758ba9b6a5c7da5 (patch)
treeafb120844844a6c1fcef3d5a66e3b385325a7079
parentd47ac78b9bcc2da2a9a2dd6aa6bbe213d569c6fc (diff)
downloadgcc-a0f9fdb29b7aebb07fc58960c758ba9b6a5c7da5.tar.gz
Fri Aug 27 01:03:48 1999 Jim Kingdon <http://developer.redhat.com> with much...
Fri Aug 27 01:03:48 1999 Jim Kingdon <http://developer.redhat.com> with much help from Jeffrey A Law and Richard Henderson * i386.md: In the 6 insns which call output_fix_trunc, earlyclobber operands[0]. Fri Aug 27 01:01:51 1999 Philip Blundell <pb@nexus.co.uk> * jump.c (duplicate_loop_exit_test): Call reg_scan_update after creating new registers. From-SVN: r29158
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386.md12
-rw-r--r--gcc/jump.c94
3 files changed, 72 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22403c9d1e8..643ee002945 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
Tue Sep 7 01:27:21 1999 Jeffrey A Law (law@cygnus.com)
+ Fri Aug 27 01:03:48 1999 Jim Kingdon <http://developer.redhat.com>
+ with much help from Jeffrey A Law and Richard Henderson
+ * i386.md: In the 6 insns which call output_fix_trunc,
+ earlyclobber operands[0].
+
+ Fri Aug 27 01:01:51 1999 Philip Blundell <pb@nexus.co.uk>
+ * jump.c (duplicate_loop_exit_test): Call reg_scan_update after
+ creating new registers.
+
Fri Aug 27 15:35:24 1999 Jeffrey A Law (law@cygnus.com)
* cse.c (fold_rtx): Work around bug in Sun V5.0 compilers.
* pa.c (emit_move_sequence): Do not stop on SUBREG_WORD of an
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index fb3e1b2ad0b..b52e2550c4d 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2711,7 +2711,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "nonimmediate_operand" "=m,!r")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,!&r")
(fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f,f"))))
(clobber (match_operand:HI 2 "memory_operand" "m,m"))
(clobber (match_operand:HI 3 "memory_operand" "m,m"))
@@ -2739,7 +2739,7 @@
}")
(define_insn ""
- [(set (match_operand:DI 0 "nonimmediate_operand" "=m,!r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,!&r")
(fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f,f"))))
(clobber (match_dup 1))
(clobber (match_operand:HI 2 "memory_operand" "m,m"))
@@ -2766,7 +2766,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "nonimmediate_operand" "=m,!r")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,!&r")
(fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f,f"))))
(clobber (match_operand:HI 2 "memory_operand" "m,m"))
(clobber (match_operand:HI 3 "memory_operand" "m,m"))
@@ -2794,7 +2794,7 @@
}")
(define_insn ""
- [(set (match_operand:DI 0 "nonimmediate_operand" "=m,!r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,!&r")
(fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f,f"))))
(clobber (match_dup 1))
(clobber (match_operand:HI 2 "memory_operand" "m,m"))
@@ -2821,7 +2821,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "nonimmediate_operand" "=m,!r")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,!&r")
(fix:SI (fix:XF (match_operand:XF 1 "register_operand" "f,f"))))
(clobber (match_operand:HI 2 "memory_operand" "m,m"))
(clobber (match_operand:HI 3 "memory_operand" "m,m"))
@@ -2849,7 +2849,7 @@
}")
(define_insn ""
- [(set (match_operand:DI 0 "nonimmediate_operand" "=m,!r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,!&r")
(fix:DI (fix:XF (match_operand:XF 1 "register_operand" "f,f"))))
(clobber (match_dup 1))
(clobber (match_operand:HI 2 "memory_operand" "m,m"))
diff --git a/gcc/jump.c b/gcc/jump.c
index e24adb26e23..6259433efd5 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -2548,7 +2548,7 @@ duplicate_loop_exit_test (loop_start)
rtx loop_start;
{
rtx insn, set, reg, p, link;
- rtx copy = 0;
+ rtx copy = 0, first_copy = 0;
int num_insns = 0;
rtx exitcode = NEXT_INSN (JUMP_LABEL (next_nonnote_insn (loop_start)));
rtx lastexit;
@@ -2661,19 +2661,20 @@ duplicate_loop_exit_test (loop_start)
/* Now copy each insn. */
for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn))
- switch (GET_CODE (insn))
- {
- case BARRIER:
- copy = emit_barrier_before (loop_start);
- break;
- case NOTE:
- /* Only copy line-number notes. */
- if (NOTE_LINE_NUMBER (insn) >= 0)
- {
- copy = emit_note_before (NOTE_LINE_NUMBER (insn), loop_start);
- NOTE_SOURCE_FILE (copy) = NOTE_SOURCE_FILE (insn);
- }
- break;
+ {
+ switch (GET_CODE (insn))
+ {
+ case BARRIER:
+ copy = emit_barrier_before (loop_start);
+ break;
+ case NOTE:
+ /* Only copy line-number notes. */
+ if (NOTE_LINE_NUMBER (insn) >= 0)
+ {
+ copy = emit_note_before (NOTE_LINE_NUMBER (insn), loop_start);
+ NOTE_SOURCE_FILE (copy) = NOTE_SOURCE_FILE (insn);
+ }
+ break;
case INSN:
copy = emit_insn_before (copy_rtx (PATTERN (insn)), loop_start);
@@ -2694,32 +2695,38 @@ duplicate_loop_exit_test (loop_start)
replace_regs (REG_NOTES (copy), reg_map, max_reg, 1);
break;
- case JUMP_INSN:
- copy = emit_jump_insn_before (copy_rtx (PATTERN (insn)), loop_start);
- if (reg_map)
- replace_regs (PATTERN (copy), reg_map, max_reg, 1);
- mark_jump_label (PATTERN (copy), copy, 0);
- if (REG_NOTES (insn))
- {
- REG_NOTES (copy) = copy_rtx (REG_NOTES (insn));
- if (reg_map)
- replace_regs (REG_NOTES (copy), reg_map, max_reg, 1);
- }
+ case JUMP_INSN:
+ copy = emit_jump_insn_before (copy_rtx (PATTERN (insn)), loop_start);
+ if (reg_map)
+ replace_regs (PATTERN (copy), reg_map, max_reg, 1);
+ mark_jump_label (PATTERN (copy), copy, 0);
+ if (REG_NOTES (insn))
+ {
+ REG_NOTES (copy) = copy_rtx (REG_NOTES (insn));
+ if (reg_map)
+ replace_regs (REG_NOTES (copy), reg_map, max_reg, 1);
+ }
- /* If this is a simple jump, add it to the jump chain. */
+ /* If this is a simple jump, add it to the jump chain. */
- if (INSN_UID (copy) < max_jump_chain && JUMP_LABEL (copy)
- && simplejump_p (copy))
- {
- jump_chain[INSN_UID (copy)]
- = jump_chain[INSN_UID (JUMP_LABEL (copy))];
- jump_chain[INSN_UID (JUMP_LABEL (copy))] = copy;
- }
- break;
+ if (INSN_UID (copy) < max_jump_chain && JUMP_LABEL (copy)
+ && simplejump_p (copy))
+ {
+ jump_chain[INSN_UID (copy)]
+ = jump_chain[INSN_UID (JUMP_LABEL (copy))];
+ jump_chain[INSN_UID (JUMP_LABEL (copy))] = copy;
+ }
+ break;
- default:
- abort ();
- }
+ default:
+ abort ();
+ }
+
+ /* Record the first insn we copied. We need it so that we can
+ scan the copied insns for new pseudo registers. */
+ if (! first_copy)
+ first_copy = copy;
+ }
/* Now clean up by emitting a jump to the end label and deleting the jump
at the start of the loop. */
@@ -2727,6 +2734,14 @@ duplicate_loop_exit_test (loop_start)
{
copy = emit_jump_insn_before (gen_jump (get_label_after (insn)),
loop_start);
+
+ /* Record the first insn we copied. We need it so that we can
+ scan the copied insns for new pseudo registers. This may not
+ be strictly necessary since we should have copied at least one
+ insn above. But I am going to be safe. */
+ if (! first_copy)
+ first_copy = copy;
+
mark_jump_label (PATTERN (copy), copy, 0);
if (INSN_UID (copy) < max_jump_chain
&& INSN_UID (JUMP_LABEL (copy)) < max_jump_chain)
@@ -2738,6 +2753,11 @@ duplicate_loop_exit_test (loop_start)
emit_barrier_before (loop_start);
}
+ /* Now scan from the first insn we copied to the last insn we copied
+ (copy) for new pseudo registers. Do this after the code to jump to
+ the end label since that might create a new pseudo too. */
+ reg_scan_update (first_copy, copy, max_reg);
+
/* Mark the exit code as the virtual top of the converted loop. */
emit_note_before (NOTE_INSN_LOOP_VTOP, exitcode);