* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77988
138bc75d-0d04-0410-961f-
82ee72b054a4
+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,
/* (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.
--- /dev/null
+/* 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);
+}
+