* simplify-rtx.c (simplify_binary_operation) [DIV]: If
gen_lowpart_common fails, use gen_lowpart_SUBREG.
* gcc.c-torture/compile/
20020103-1.c: New test.
From-SVN: r48514
+2002-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ * simplify-rtx.c (simplify_binary_operation) [DIV]: If
+ gen_lowpart_common fails, use gen_lowpart_SUBREG.
+
2002-01-03 Turly O'Connor <turly@apple.com>
+
* darwin.c (machopic_output_possible_stub_label): Don't generate
stub routines for pseudo-stubs which we've just defined.
case DIV:
if (trueop1 == CONST1_RTX (mode))
{
+ /* On some platforms DIV uses narrower mode than its
+ operands. */
rtx x = gen_lowpart_common (mode, op0);
- return x ? x : op0;
+ if (x)
+ return x;
+ else if (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode)
+ return gen_lowpart_SUBREG (mode, op0);
+ else
+ return op0;
}
/* In IEEE floating point, 0/x is not always 0. */
* g++.dg/other/debug2.C: New test.
+ * gcc.c-torture/compile/20020103-1.c: New test.
+
2002-01-02 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/gnu89-init-1.c: Added new tests.
--- /dev/null
+/* This testcase failed on Alpha at -O2 when simplifying conditional
+ expressions. */
+
+int foo (void);
+
+struct A
+{
+ int a, b, c, d;
+};
+
+void bar (struct A *x)
+{
+ int e, f;
+
+ e = foo ();
+ e = e / x->b;
+ if (e < 1)
+ e = 1;
+ f = (x->a + x->c) / e;
+ if (f < x->d)
+ x->d -= (1 << 16) / 8;
+}