Commit bc02f8d3 by Jakub Jelinek Committed by Jakub Jelinek

combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask…

combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask (not just mask) are set in C.

	* combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask
	(not just mask) are set in C.

	* gcc.c-torture/execute/20021118-3.c: New test.

From-SVN: r59295
parent 13b42735
2002-11-20 Jakub Jelinek <jakub@redhat.com>
* combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask
(not just mask) are set in C.
2002-11-19 Andreas Jaeger <aj@suse.de>
* loop.c (record_giv): Initialize not_replaceable.
......
......@@ -6978,10 +6978,10 @@ force_to_mode (x, mode, mask, reg, just_select)
return force_to_mode (x, mode, mask, reg, next_select);
}
/* Similarly, if C contains every bit in the mask, then we may
/* Similarly, if C contains every bit in the fuller_mask, then we may
replace with (not Y). */
if (GET_CODE (XEXP (x, 0)) == CONST_INT
&& ((INTVAL (XEXP (x, 0)) | (HOST_WIDE_INT) mask)
&& ((INTVAL (XEXP (x, 0)) | (HOST_WIDE_INT) fuller_mask)
== INTVAL (XEXP (x, 0))))
{
x = simplify_gen_unary (NOT, GET_MODE (x),
......
2002-11-20 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20021118-3.c: New test.
2002-11-19 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/compile/20021119-1.c: New test.
......
extern void abort (void);
extern void exit (int);
int
foo (int x)
{
if (x == -2 || -x - 100 >= 0)
abort ();
return 0;
}
int
main ()
{
foo (-3);
foo (-99);
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