+2009-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/38774
+ * combine.c (simplify_set): When undoing cc_use change, don't do
+ PUT_CODE on the newly created comparison, but instead put back the
+ old comparison.
+
2009-01-13 Joseph Myers <joseph@codesourcery.com>
* doc/invoke.texi (ARM Options): Update lists of -mcpu and -march
{
int other_changed_previously = other_changed;
unsigned HOST_WIDE_INT mask;
+ rtx old_cc_use = *cc_use;
SUBST (*cc_use, gen_rtx_fmt_ee (new_code, GET_MODE (*cc_use),
dest, const0_rtx));
if ((recog_for_combine (&pat, other_insn, ¬e) < 0
&& ! check_asm_operands (pat)))
{
- PUT_CODE (*cc_use, old_code);
+ *cc_use = old_cc_use;
other_changed = 0;
op0 = simplify_gen_binary (XOR, GET_MODE (op0),
2009-01-13 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/38774
+ * gcc.dg/torture/pr38774.c: New test.
+
PR c++/38795
* g++.dg/cpp0x/pr38795.C: New test.
--- /dev/null
+/* PR rtl-optimization/38774 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-options "-march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+extern int bar (void);
+volatile int g;
+
+int
+foo (void)
+{
+ int a = 1 >= bar ();
+ if ((1 > 9223372036854775807LL - a && 1 - a ? : 1 + a) & 1)
+ return g;
+ return 0;
+}