Commit a10016d3 by Ian Lance Taylor

re PR rtl-optimization/7871 (ICE on legal code, global register variables problems)

	PR optimization/7871
	* flow.c (mark_set_1): Don't add LOG_LINKS for global registers
	from or to call insns.
	(propagate_one_insn): Interpret calls as setting global registers,
	not merely clobbering them.

From-SVN: r78601
parent 6bd5c787
2004-02-27 Ian Lance Taylor <ian@wasabisystems.com>
PR optimization/7871
* flow.c (mark_set_1): Don't add LOG_LINKS for global registers
from or to call insns.
2004-02-27 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/7871
* flow.c (propagate_one_insn): Interpret calls as setting global
registers, not merely clobbering them.
2004-02-27 Dale Johannesen <dalej@apple.com> 2004-02-27 Dale Johannesen <dalej@apple.com>
* config/darwin.c (machopic_output_possible_stub_label): Remove. * config/darwin.c (machopic_output_possible_stub_label): Remove.
config/darwin-protos.h: Ditto. config/darwin-protos.h: Ditto.
config/darwin.h: Remove call to it. config/darwin.h: Remove call to it.
......
...@@ -1772,8 +1772,9 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn) ...@@ -1772,8 +1772,9 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn)
current_function_return_rtx, current_function_return_rtx,
(rtx *) 0))) (rtx *) 0)))
{ {
enum rtx_code code = global_regs[i] ? SET : CLOBBER;
/* We do not want REG_UNUSED notes for these registers. */ /* We do not want REG_UNUSED notes for these registers. */
mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn, mark_set_1 (pbi, code, regno_reg_rtx[i], cond, insn,
pbi->flags & ~(PROP_DEATH_NOTES | PROP_REG_INFO)); pbi->flags & ~(PROP_DEATH_NOTES | PROP_REG_INFO));
} }
} }
...@@ -2799,10 +2800,18 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c ...@@ -2799,10 +2800,18 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c
in ASM_OPERANDs. If these registers get replaced, in ASM_OPERANDs. If these registers get replaced,
we might wind up changing the semantics of the insn, we might wind up changing the semantics of the insn,
even if reload can make what appear to be valid even if reload can make what appear to be valid
assignments later. */ assignments later.
We don't build a LOG_LINK for global registers to
or from a function call. We don't want to let
combine think that it knows what is going on with
global registers. */
if (y && (BLOCK_NUM (y) == blocknum) if (y && (BLOCK_NUM (y) == blocknum)
&& (regno_first >= FIRST_PSEUDO_REGISTER && (regno_first >= FIRST_PSEUDO_REGISTER
|| asm_noperands (PATTERN (y)) < 0)) || (asm_noperands (PATTERN (y)) < 0
&& ! ((GET_CODE (insn) == CALL_INSN
|| GET_CODE (y) == CALL_INSN)
&& global_regs[regno_first]))))
LOG_LINKS (y) = alloc_INSN_LIST (insn, LOG_LINKS (y)); LOG_LINKS (y) = alloc_INSN_LIST (insn, LOG_LINKS (y));
} }
} }
......
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