Commit e69cdc12 by Eric Botcazou Committed by Eric Botcazou

re PR rtl-optimization/12799 (faulty mov->add change clobbers the CC register)

	PR optimization/12799
	* postreload.c (reload_cse_move2add): Generate the add2
	patterns manually.

From-SVN: r73195
parent 0a9e65f9
2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/12799
* postreload.c (reload_cse_move2add): Generate the add2
patterns manually.
2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]:
Return 0 for all complex modes whose size is lesser or equal to
a word. Add a ??? comment for the condition used with 16-byte
......
......@@ -1199,14 +1199,12 @@ reload_cse_move2add (rtx first)
else if (rtx_cost (new_src, PLUS) < rtx_cost (src, SET)
&& have_add2_insn (reg, new_src))
{
rtx newpat = gen_add2_insn (reg, new_src);
if (INSN_P (newpat) && NEXT_INSN (newpat) == NULL_RTX)
newpat = PATTERN (newpat);
/* If it was the first insn of a sequence or
some other emitted insn, validate_change will
reject it. */
validate_change (insn, &PATTERN (insn),
newpat, 0);
rtx newpat = gen_rtx_SET (VOIDmode,
reg,
gen_rtx_PLUS (GET_MODE (reg),
reg,
new_src));
validate_change (insn, &PATTERN (insn), newpat, 0);
}
else
{
......@@ -1288,10 +1286,11 @@ reload_cse_move2add (rtx first)
< COSTS_N_INSNS (1) + rtx_cost (src3, SET))
&& have_add2_insn (reg, new_src))
{
rtx newpat = gen_add2_insn (reg, new_src);
if (INSN_P (newpat)
&& NEXT_INSN (newpat) == NULL_RTX)
newpat = PATTERN (newpat);
rtx newpat = gen_rtx_SET (VOIDmode,
reg,
gen_rtx_PLUS (GET_MODE (reg),
reg,
new_src));
success
= validate_change (next, &PATTERN (next),
newpat, 0);
......
2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/20031102-1.c: New test.
2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/complex-1.c: New test.
2003-11-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
......
/* PR optimization/12799 */
/* Origin: Pratap Subrahmanyam <pratap@vmware.com> */
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -march=i686" { target i686-*-* } } */
/* Verify that reload_cse_move2add doesn't add unexpected CLOBBERs. */
extern void abort(void);
int loo = 1;
__inline__ char InlineFunc(void)
{
return __builtin_expect(!!(loo == 1), 1);
}
int FooBar(void)
{
int i;
int var1 = InlineFunc() ? 2046 : 1023;
int var2 = InlineFunc() ? 512 : 1024;
for (i = 0; i < var1; i++)
;
if (InlineFunc() && var2 != 512)
abort();
return 0;
}
int main(void)
{
return FooBar();
}
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