* 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
+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>
PR target/5672
{
/* Set if BB is the forwarder block to avoid too many
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
regset nonequal;
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
want to extend this code to tablejumps and others. */
if (!e->src->succ->succ_next || e->src->succ->succ_next->succ_next)
return NULL;
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. */
- if (!any_condjump_p (e->src->end) || !any_condjump_p (b->end)
- || !onlyjump_p (b->end))
+ if (!any_condjump_p (e->src->end))
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);
set2 = pc_set (b->end);
for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end);
insn = NEXT_INSN (insn))
if (INSN_P (insn) && side_effects_p (PATTERN (insn)))
- return NULL;
+ {
+ BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK);
+ return NULL;
+ }
cselib_init ();
/* Later we should clear nonequal of dead registers. So far we don't
have life information in cfg_cleanup. */
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
former block. */
if (mode & CLEANUP_CROSSJUMP)
remove_fake_edges ();
- for (i = 0; i < n_basic_blocks; i++)
- BASIC_BLOCK (i)->aux = NULL;
+ clear_aux_for_blocks ();
return changed_overall;
}
if (! ix86_decompose_address (op, &parts))
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. */
if (parts.index)
{
rtx scale_rtx = NULL_RTX;
int retval = 1;
- if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG)
+ if (REG_P (addr) || GET_CODE (addr) == SUBREG)
base = addr;
else if (GET_CODE (addr) == PLUS)
{
if (!ix86_decompose_address (x, &parts))
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. */
if (parts.disp && parts.disp != const0_rtx)
cost--;
if (base)
{
+ rtx reg;
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";
goto report_error;
goto report_error;
}
- if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
- || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
+ if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
+ || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg)))
{
reason = "base is not valid";
goto report_error;
if (index)
{
+ rtx reg;
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";
goto report_error;
goto report_error;
}
- if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index))
- || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index)))
+ if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg))
+ || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg)))
{
reason = "index is not valid";
goto report_error;
regset_head new_live_at_end_head;
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);
new_live_at_end = INITIALIZE_REG_SET (new_live_at_end_head);
call_used = INITIALIZE_REG_SET (call_used_head);
/* Promote REG_EQUAL notes to REG_EQUIV notes and adjust status of affected
registers. */
- update_equiv_regs ();
+ if (optimize)
+ update_equiv_regs ();
/* This sets the maximum number of quantities we can have. Quantity
numbers start at zero and we can have one for each pseudo. */
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);