+Fri Oct 29 14:34:17 1999 Richard Henderson <rth@cygnus.com>
+
+ * flow.c (count_or_remove_death_notes): Equate NULL with the
+ universal set.
+
+ * jump.c, reg-stack.c, toplev.c: Revert Oct 27 change.
+ * toplev.c (rest_of_compilation): Rebuild CFG immediately before
+ dbr_schedule.
+
+ * i386.c (pic_label_no): Delete.
+ (ix86_attr_length_default): Don't use single_set to peek
+ inside a parallel.
+
+ * recog.c (peephole2_optimize): Allow recog_next_insn to index
+ the first insn after bb->end.
+ * i386.md (push mem peeps): Scratch is live after evaluation
+ of the memory.
+ (cmp mem peep): Similarly.
+
Fri Oct 29 11:50:11 1999 Catherine Moore <clm@cygnus.com>
* calls.c (emit_library_call_value): Fix declaration of alignment_pad.
rtx stack_locals[(int) MAX_MACHINE_MODE][MAX_386_STACK_LOCALS];
};
-static int pic_label_no = 0;
-
#define ix86_stack_locals (current_function->machine->stack_locals)
/* which cpu are we scheduling for */
break;
case TYPE_LEA:
- len += memory_address_length (SET_SRC (single_set (insn)));
- goto just_opcode;
+ {
+ /* Irritatingly, single_set doesn't work with REG_UNUSED present,
+ as we'll get from running life_analysis during reg-stack when
+ not optimizing. */
+ rtx set = PATTERN (insn);
+ if (GET_CODE (set) == SET)
+ ;
+ else if (GET_CODE (set) == PARALLEL
+ && XVECLEN (set, 0) == 2
+ && GET_CODE (XVECEXP (set, 0, 0)) == SET
+ && GET_CODE (XVECEXP (set, 0, 1)) == CLOBBER)
+ set = XVECEXP (set, 0, 0);
+ else
+ abort ();
+
+ len += memory_address_length (SET_SRC (set));
+ goto just_opcode;
+ }
case TYPE_OTHER:
case TYPE_MULTI:
;; Don't push memory operands
(define_peephole2
- [(match_scratch:SI 2 "r")
- (set (match_operand:SI 0 "push_operand" "")
- (match_operand:SI 1 "memory_operand" ""))]
+ [(set (match_operand:SI 0 "push_operand" "")
+ (match_operand:SI 1 "memory_operand" ""))
+ (match_scratch:SI 2 "r")]
"! optimize_size && ! TARGET_PUSH_MEMORY"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
"")
(define_peephole2
- [(match_scratch:HI 2 "r")
- (set (match_operand:HI 0 "push_operand" "")
- (match_operand:HI 1 "memory_operand" ""))]
+ [(set (match_operand:HI 0 "push_operand" "")
+ (match_operand:HI 1 "memory_operand" ""))
+ (match_scratch:HI 2 "r")]
"! optimize_size && ! TARGET_PUSH_MEMORY"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
"")
(define_peephole2
- [(match_scratch:QI 2 "q")
- (set (match_operand:QI 0 "push_operand" "")
- (match_operand:QI 1 "memory_operand" ""))]
+ [(set (match_operand:QI 0 "push_operand" "")
+ (match_operand:QI 1 "memory_operand" ""))
+ (match_scratch:QI 2 "q")]
"! optimize_size && ! TARGET_PUSH_MEMORY"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
;; Don't compare memory with zero, load and use a test instead.
(define_peephole2
- [(match_scratch:SI 3 "r")
- (set (reg:CCNO 17)
+ [(set (reg:CCNO 17)
(compare:CCNO (match_operand:SI 0 "memory_operand" "")
- (const_int 0)))]
+ (const_int 0)))
+ (match_scratch:SI 3 "r")]
"! optimize_size"
[(set (match_dup 3) (match_dup 0))
(set (reg:CCNO 17) (compare:CCNO (match_dup 3) (const_int 0)))]
}
/* Optionally removes all the REG_DEAD and REG_UNUSED notes from a set of
- blocks. Returns a count of the number of registers that died. */
+ blocks. If BLOCKS is NULL, assume the universal set. Returns a count
+ of the number of registers that died. */
int
count_or_remove_death_notes (blocks, kill)
basic_block bb;
rtx insn;
- if (! TEST_BIT (blocks, i))
+ if (blocks && ! TEST_BIT (blocks, i))
continue;
bb = BASIC_BLOCK (i);
#include "expr.h"
#include "real.h"
#include "except.h"
-#include "basic-block.h"
-#include "output.h"
#include "toplev.h"
/* ??? Eventually must record somehow the labels used by jumps
int first = 1;
int max_uid = 0;
rtx last_insn;
- int did_cross_jump = 0;
cross_jump_death_matters = (cross_jump == 2);
max_uid = init_label_info (f) + 1;
if (newjpos != 0)
{
- did_cross_jump = 1;
do_cross_jump (insn, newjpos, newlpos);
/* Make the old conditional jump
into an unconditional one. */
if (newjpos != 0)
{
- did_cross_jump = 1;
do_cross_jump (insn, newjpos, newlpos);
changed = 1;
next = insn;
if (newjpos != 0)
{
- did_cross_jump = 1;
do_cross_jump (insn, newjpos, newlpos);
changed = 1;
next = insn;
/* Show JUMP_CHAIN no longer valid. */
jump_chain = 0;
-
-#if defined(DELAY_SLOTS) || defined(STACK_REGS)
- /* ??? Keep the CFG up to date after cross-jumping. */
- if (did_cross_jump && !cross_jump_death_matters)
- {
- sbitmap blocks;
-
- find_basic_blocks (f, old_max_reg, NULL, 0);
-
- blocks = sbitmap_alloc (n_basic_blocks);
- sbitmap_ones (blocks);
- count_or_remove_death_notes (blocks, 1);
- sbitmap_free (blocks);
-
- life_analysis (f, old_max_reg, NULL, 0);
- }
-#endif
}
\f
/* Initialize LABEL_NUSES and JUMP_LABEL fields. Delete any REG_LABEL
care about subsequent life info; recog_last_allowed_insn to
restrict how far forward we will allow the match to proceed. */
- recog_last_allowed_insn = bb->end;
+ recog_last_allowed_insn = NEXT_INSN (bb->end);
for (insn = bb->end; ; insn = prev)
{
prev = PREV_INSN (insn);
if (insn == bb->head)
bb->head = NEXT_INSN (prev);
- recog_last_allowed_insn = prev;
+ recog_last_allowed_insn = NEXT_INSN (prev);
SET_BIT (blocks, i);
changed = 1;
}
if (dbr_sched_dump)
open_dump_file (".19.dbr", decl_printable_name (decl, 2));
- TIMEVAR (dbr_sched_time, dbr_schedule (insns, rtl_dump_file));
+ TIMEVAR
+ (dbr_sched_time,
+ {
+ /* ??? Keep the CFG up to date after cross-jumping. */
+ find_basic_blocks (insns, max_reg_num (), rtl_dump_file, 1);
+ count_or_remove_death_notes (NULL, 1);
+ life_analysis (insns, max_reg_num (), rtl_dump_file, 1);
+
+ dbr_schedule (insns, rtl_dump_file);
+ });
if (dbr_sched_dump)
{
ggc_collect ();
#endif
+ /* Shorten branches. */
+ TIMEVAR (shorten_branch_time,
+ {
+ shorten_branches (get_insns ());
+ });
+
#ifdef STACK_REGS
if (stack_reg_dump)
open_dump_file (".20.stack", decl_printable_name (decl, 2));
ggc_collect ();
#endif
- /* Shorten branches. */
- TIMEVAR (shorten_branch_time,
- {
- shorten_branches (get_insns ());
- });
-
/* Now turn the rtl into assembler code. */
TIMEVAR (final_time,