Commit e99af66b by Jakub Jelinek Committed by Jakub Jelinek

i386.c (ix86_expand_int_movcc): If overlap between out and comparison sequence has been detected...

	* config/i386/i386.c (ix86_expand_int_movcc): If overlap between
	out and comparison sequence has been detected, put result into
	proper temporary pseudo.

	* gcc.c-torture/execute/20010422-1.c: New test.

From-SVN: r41536
parent 6bda7a5e
2001-04-25 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (ix86_expand_int_movcc): If overlap between
out and comparison sequence has been detected, put result into
proper temporary pseudo.
2001-04-24 Zack Weinberg <zackw@stanford.edu> 2001-04-24 Zack Weinberg <zackw@stanford.edu>
* Makefile.in (LIB2FUNCS): Remove _varargs and __dummy. * Makefile.in (LIB2FUNCS): Remove _varargs and __dummy.
......
...@@ -6279,7 +6279,7 @@ ix86_expand_int_movcc (operands) ...@@ -6279,7 +6279,7 @@ ix86_expand_int_movcc (operands)
* Size 5 - 8. * Size 5 - 8.
*/ */
if (ct) if (ct)
emit_insn (gen_addsi3 (out, out, GEN_INT (ct))); emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (ct)));
} }
else if (cf == -1) else if (cf == -1)
{ {
...@@ -6290,7 +6290,7 @@ ix86_expand_int_movcc (operands) ...@@ -6290,7 +6290,7 @@ ix86_expand_int_movcc (operands)
* *
* Size 8. * Size 8.
*/ */
emit_insn (gen_iorsi3 (out, out, GEN_INT (ct))); emit_insn (gen_iorsi3 (tmp, tmp, GEN_INT (ct)));
} }
else if (diff == -1 && ct) else if (diff == -1 && ct)
{ {
...@@ -6304,7 +6304,7 @@ ix86_expand_int_movcc (operands) ...@@ -6304,7 +6304,7 @@ ix86_expand_int_movcc (operands)
*/ */
emit_insn (gen_one_cmplsi2 (tmp, tmp)); emit_insn (gen_one_cmplsi2 (tmp, tmp));
if (cf) if (cf)
emit_insn (gen_addsi3 (out, out, GEN_INT (cf))); emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (cf)));
} }
else else
{ {
...@@ -6316,10 +6316,10 @@ ix86_expand_int_movcc (operands) ...@@ -6316,10 +6316,10 @@ ix86_expand_int_movcc (operands)
* *
* Size 8 - 11. * Size 8 - 11.
*/ */
emit_insn (gen_andsi3 (out, out, GEN_INT (trunc_int_for_mode emit_insn (gen_andsi3 (tmp, tmp, GEN_INT (trunc_int_for_mode
(cf - ct, SImode)))); (cf - ct, SImode))));
if (ct) if (ct)
emit_insn (gen_addsi3 (out, out, GEN_INT (ct))); emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (ct)));
} }
if (tmp != out) if (tmp != out)
......
2001-04-25 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20010422-1.c: New test.
2001-04-25 Nathan Sidwell <nathan@codesourcery.com> 2001-04-25 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.ns/type2.C: New test. * g++.old-deja/g++.ns/type2.C: New test.
......
unsigned int foo(unsigned int x)
{
if (x < 5)
x = 4;
else
x = 8;
return x;
}
int main(void)
{
if (foo (8) != 8)
abort ();
exit (0);
}
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