Commit db33236e by Ulrich Weigand Committed by Ulrich Weigand

combine.c (simplify_if_then_else): Do not replace (if_then_else (ne reg 0) (0)…

combine.c (simplify_if_then_else): Do not replace (if_then_else (ne reg 0) (0) (const_int)) by (reg) if...

ChangeLog:

	* combine.c (simplify_if_then_else): Do not replace
	(if_then_else (ne reg 0) (0) (const_int)) by (reg) if the
	modes differ.

testsuite/ChangeLog:

	* gcc.dg/20040217-1.c: New test.

From-SVN: r77988
parent e4c6167f
2004-02-17 Ulrich Weigand <uweigand@de.ibm.com>
* combine.c (simplify_if_then_else): Do not replace
(if_then_else (ne reg 0) (0) (const_int)) by (reg) if the
modes differ.
2004-02017 Steven Bosscher <stevenb@suse.de>
* (c-decl.c, c-semantics.c, calls.c, cgraph.c, cgraphunit.c,
......
......@@ -4930,6 +4930,7 @@ simplify_if_then_else (rtx x)
/* (IF_THEN_ELSE (NE REG 0) (0) (8)) is REG for nonzero_bits (REG) == 8. */
if (true_code == NE && XEXP (cond, 1) == const0_rtx
&& false_rtx == const0_rtx && GET_CODE (true_rtx) == CONST_INT
&& GET_MODE (XEXP (cond, 0)) == mode
&& (INTVAL (true_rtx) & GET_MODE_MASK (mode))
== nonzero_bits (XEXP (cond, 0), mode)
&& (i = exact_log2 (INTVAL (true_rtx) & GET_MODE_MASK (mode))) >= 0)
......
2004-02-17 Ulrich Weigand <uweigand@de.ibm.com>
* gcc.dg/20040217-1.c: New test.
2004-02-17 Zack Weinberg <zack@codesourcery.com>
* gcc.c-torture/execute/990208-1.x: Delete.
......
/* This used to ICE on s390x due to a bug in simplify_if_then_else. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
extern void use (int);
void test (void)
{
union
{
unsigned long ul;
signed char sc;
} u;
u.sc = 8;
u.sc &= 25;
use (u.sc);
}
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