Commit 1540f9eb by Jan Hubicka Committed by Jan Hubicka

local-alloc.c (local_alloc): Avoid call of update_equiv_regs when not optimizing.

	* local-alloc.c (local_alloc): Avoid call of update_equiv_regs when not optimizing.

	* toplev.c (rest_of_compilation): Cann mark_constant_function
	only when optimizing.

	* flow.c (calculate_global_regs_live): Ensure that all AUX fields are NULL.

	* cfgcleanup.c (bb_flags): Add BB_NONTHREADABLE_BLOCK.
	(thread_jump): Set BB_NONTHREADABLE_BLOCK, check it.
	(try_optimize_cfg): clear all AUX fields.

	* i386.c (aligned_operand): Be prepared for SUBREGed registers.
	(ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
	(ix86_address_cost): Be prepared for SUBREGed registers.
	(legitimate_address_p): Accept SUBREGed registers.

From-SVN: r51604
parent d8397504
Sat Mar 30 14:08:55 CET 2002 Jan Hubicka <jh@suse.cz>
* local-alloc.c (local_alloc): Avoid call of update_equiv_regs when not optimizing.
* toplev.c (rest_of_compilation): Cann mark_constant_function
only when optimizing.
* flow.c (calculate_global_regs_live): Ensure that all AUX fields are NULL.
* cfgcleanup.c (bb_flags): Add BB_NONTHREADABLE_BLOCK.
(thread_jump): Set BB_NONTHREADABLE_BLOCK, check it.
(try_optimize_cfg): clear all AUX fields.
* i386.c (aligned_operand): Be prepared for SUBREGed registers.
(ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
(ix86_address_cost): Be prepared for SUBREGed registers.
(legitimate_address_p): Accept SUBREGed registers.
2002-03-29 Richard Henderson <rth@redhat.com> 2002-03-29 Richard Henderson <rth@redhat.com>
PR target/5672 PR target/5672
......
...@@ -54,7 +54,8 @@ enum bb_flags ...@@ -54,7 +54,8 @@ enum bb_flags
{ {
/* Set if BB is the forwarder block to avoid too many /* Set if BB is the forwarder block to avoid too many
forwarder_block_p calls. */ forwarder_block_p calls. */
BB_FORWARDER_BLOCK = 1 BB_FORWARDER_BLOCK = 1,
BB_NONTHREADABLE_BLOCK = 2
}; };
#define BB_FLAGS(BB) (enum bb_flags) (BB)->aux #define BB_FLAGS(BB) (enum bb_flags) (BB)->aux
...@@ -279,17 +280,28 @@ thread_jump (mode, e, b) ...@@ -279,17 +280,28 @@ thread_jump (mode, e, b)
regset nonequal; regset nonequal;
bool failed = false; bool failed = false;
if (BB_FLAGS (b) & BB_NONTHREADABLE_BLOCK)
return NULL;
/* At the moment, we do handle only conditional jumps, but later we may /* At the moment, we do handle only conditional jumps, but later we may
want to extend this code to tablejumps and others. */ want to extend this code to tablejumps and others. */
if (!e->src->succ->succ_next || e->src->succ->succ_next->succ_next) if (!e->src->succ->succ_next || e->src->succ->succ_next->succ_next)
return NULL; return NULL;
if (!b->succ || !b->succ->succ_next || b->succ->succ_next->succ_next) if (!b->succ || !b->succ->succ_next || b->succ->succ_next->succ_next)
return NULL; {
BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK);
return NULL;
}
/* Second branch must end with onlyjump, as we will eliminate the jump. */ /* Second branch must end with onlyjump, as we will eliminate the jump. */
if (!any_condjump_p (e->src->end) || !any_condjump_p (b->end) if (!any_condjump_p (e->src->end))
|| !onlyjump_p (b->end))
return NULL; return NULL;
if (!any_condjump_p (b->end) || !onlyjump_p (b->end))
{
BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK);
return NULL;
}
set1 = pc_set (e->src->end); set1 = pc_set (e->src->end);
set2 = pc_set (b->end); set2 = pc_set (b->end);
...@@ -324,7 +336,10 @@ thread_jump (mode, e, b) ...@@ -324,7 +336,10 @@ thread_jump (mode, e, b)
for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end); for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end);
insn = NEXT_INSN (insn)) insn = NEXT_INSN (insn))
if (INSN_P (insn) && side_effects_p (PATTERN (insn))) if (INSN_P (insn) && side_effects_p (PATTERN (insn)))
return NULL; {
BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK);
return NULL;
}
cselib_init (); cselib_init ();
...@@ -363,7 +378,10 @@ thread_jump (mode, e, b) ...@@ -363,7 +378,10 @@ thread_jump (mode, e, b)
/* Later we should clear nonequal of dead registers. So far we don't /* Later we should clear nonequal of dead registers. So far we don't
have life information in cfg_cleanup. */ have life information in cfg_cleanup. */
if (failed) if (failed)
goto failed_exit; {
BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK);
goto failed_exit;
}
/* cond2 must not mention any register that is not equal to the /* cond2 must not mention any register that is not equal to the
former block. */ former block. */
...@@ -1723,8 +1741,7 @@ try_optimize_cfg (mode) ...@@ -1723,8 +1741,7 @@ try_optimize_cfg (mode)
if (mode & CLEANUP_CROSSJUMP) if (mode & CLEANUP_CROSSJUMP)
remove_fake_edges (); remove_fake_edges ();
for (i = 0; i < n_basic_blocks; i++) clear_aux_for_blocks ();
BASIC_BLOCK (i)->aux = NULL;
return changed_overall; return changed_overall;
} }
......
...@@ -3467,6 +3467,11 @@ aligned_operand (op, mode) ...@@ -3467,6 +3467,11 @@ aligned_operand (op, mode)
if (! ix86_decompose_address (op, &parts)) if (! ix86_decompose_address (op, &parts))
abort (); abort ();
if (parts.base && GET_CODE (parts.base) == SUBREG)
parts.base = SUBREG_REG (parts.base);
if (parts.index && GET_CODE (parts.index) == SUBREG)
parts.index = SUBREG_REG (parts.index);
/* Look for some component that isn't known to be aligned. */ /* Look for some component that isn't known to be aligned. */
if (parts.index) if (parts.index)
{ {
...@@ -4404,7 +4409,7 @@ ix86_decompose_address (addr, out) ...@@ -4404,7 +4409,7 @@ ix86_decompose_address (addr, out)
rtx scale_rtx = NULL_RTX; rtx scale_rtx = NULL_RTX;
int retval = 1; int retval = 1;
if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG) if (REG_P (addr) || GET_CODE (addr) == SUBREG)
base = addr; base = addr;
else if (GET_CODE (addr) == PLUS) else if (GET_CODE (addr) == PLUS)
{ {
...@@ -4531,6 +4536,11 @@ ix86_address_cost (x) ...@@ -4531,6 +4536,11 @@ ix86_address_cost (x)
if (!ix86_decompose_address (x, &parts)) if (!ix86_decompose_address (x, &parts))
abort (); abort ();
if (parts.base && GET_CODE (parts.base) == SUBREG)
parts.base = SUBREG_REG (parts.base);
if (parts.index && GET_CODE (parts.index) == SUBREG)
parts.index = SUBREG_REG (parts.index);
/* More complex memory references are better. */ /* More complex memory references are better. */
if (parts.disp && parts.disp != const0_rtx) if (parts.disp && parts.disp != const0_rtx)
cost--; cost--;
...@@ -4745,9 +4755,15 @@ legitimate_address_p (mode, addr, strict) ...@@ -4745,9 +4755,15 @@ legitimate_address_p (mode, addr, strict)
if (base) if (base)
{ {
rtx reg;
reason_rtx = base; reason_rtx = base;
if (GET_CODE (base) != REG) if (GET_CODE (base) == SUBREG)
reg = SUBREG_REG (base);
else
reg = base;
if (GET_CODE (reg) != REG)
{ {
reason = "base is not a register"; reason = "base is not a register";
goto report_error; goto report_error;
...@@ -4759,8 +4775,8 @@ legitimate_address_p (mode, addr, strict) ...@@ -4759,8 +4775,8 @@ legitimate_address_p (mode, addr, strict)
goto report_error; goto report_error;
} }
if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base)) if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
|| (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base))) || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg)))
{ {
reason = "base is not valid"; reason = "base is not valid";
goto report_error; goto report_error;
...@@ -4775,9 +4791,15 @@ legitimate_address_p (mode, addr, strict) ...@@ -4775,9 +4791,15 @@ legitimate_address_p (mode, addr, strict)
if (index) if (index)
{ {
rtx reg;
reason_rtx = index; reason_rtx = index;
if (GET_CODE (index) != REG) if (GET_CODE (index) == SUBREG)
reg = SUBREG_REG (index);
else
reg = index;
if (GET_CODE (reg) != REG)
{ {
reason = "index is not a register"; reason = "index is not a register";
goto report_error; goto report_error;
...@@ -4789,8 +4811,8 @@ legitimate_address_p (mode, addr, strict) ...@@ -4789,8 +4811,8 @@ legitimate_address_p (mode, addr, strict)
goto report_error; goto report_error;
} }
if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index)) if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg))
|| (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index))) || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg)))
{ {
reason = "index is not valid"; reason = "index is not valid";
goto report_error; goto report_error;
......
...@@ -1071,6 +1071,16 @@ calculate_global_regs_live (blocks_in, blocks_out, flags) ...@@ -1071,6 +1071,16 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
regset_head new_live_at_end_head; regset_head new_live_at_end_head;
int i; int i;
/* Some passes used to forget clear aux field of basic block causing
sick behaviour here. */
#ifdef ENABLE_CHECKING
if (ENTRY_BLOCK_PTR->aux || EXIT_BLOCK_PTR->aux)
abort ();
for (i = 0; i < n_basic_blocks; i++)
if (BASIC_BLOCK (i)->aux)
abort ();
#endif
tmp = INITIALIZE_REG_SET (tmp_head); tmp = INITIALIZE_REG_SET (tmp_head);
new_live_at_end = INITIALIZE_REG_SET (new_live_at_end_head); new_live_at_end = INITIALIZE_REG_SET (new_live_at_end_head);
call_used = INITIALIZE_REG_SET (call_used_head); call_used = INITIALIZE_REG_SET (call_used_head);
......
...@@ -352,7 +352,8 @@ local_alloc () ...@@ -352,7 +352,8 @@ local_alloc ()
/* Promote REG_EQUAL notes to REG_EQUIV notes and adjust status of affected /* Promote REG_EQUAL notes to REG_EQUIV notes and adjust status of affected
registers. */ registers. */
update_equiv_regs (); if (optimize)
update_equiv_regs ();
/* This sets the maximum number of quantities we can have. Quantity /* This sets the maximum number of quantities we can have. Quantity
numbers start at zero and we can have one for each pseudo. */ numbers start at zero and we can have one for each pseudo. */
......
...@@ -2856,7 +2856,8 @@ rest_of_compilation (decl) ...@@ -2856,7 +2856,8 @@ rest_of_compilation (decl)
life_analyzis rarely eliminates modification of external memory. life_analyzis rarely eliminates modification of external memory.
*/ */
mark_constant_function (); if (optimize)
mark_constant_function ();
close_dump_file (DFI_cfg, print_rtl_with_bb, insns); close_dump_file (DFI_cfg, print_rtl_with_bb, insns);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment