2012-10-24 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/55010
+ * cse.c (fold_rtx) <RTX_COMPARE>: Call copy_rtx on folded_arg{0,1}
+ before passing it to simplify_relational_operation.
+
PR debug/54828
* gimple.h (is_gimple_sizepos): New inline function.
* gimplify.c (gimplify_one_sizepos): Use it. Remove useless
}
{
- rtx op0 = const_arg0 ? const_arg0 : folded_arg0;
- rtx op1 = const_arg1 ? const_arg1 : folded_arg1;
- new_rtx = simplify_relational_operation (code, mode, mode_arg0, op0, op1);
+ rtx op0 = const_arg0 ? const_arg0 : copy_rtx (folded_arg0);
+ rtx op1 = const_arg1 ? const_arg1 : copy_rtx (folded_arg1);
+ new_rtx = simplify_relational_operation (code, mode, mode_arg0,
+ op0, op1);
}
break;
2012-10-24 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/55010
+ * gcc.dg/pr55010.c: New test.
+
PR debug/54828
* g++.dg/debug/pr54828.C: New test.
--- /dev/null
+/* PR rtl-optimization/55010 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+long long int a;
+unsigned long long int b;
+
+void
+foo (void)
+{
+ a = (a < 0) / ((a -= b) ? b >= ((b = a) || 0) : 0);
+}