Tom de Vries <tom@codesourcery.com>
PR rtl-opt/50380
gcc/
* cse.c (find_comparison_args): Detect fixed point and
bail early.
gcc/testsuite/
* gcc.c-torture/compile/pr50380.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182498
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-12-19 Sandra Loosemore <sandra@codesourcery.com>
+ Tom de Vries <tom@codesourcery.com>
+
+ PR rtl-opt/50380
+ * cse.c (find_comparison_args): Detect fixed point and
+ bail early.
+
2011-12-19 Aldy Hernandez <aldyh@redhat.com>
PR middle-end/51411
if (! exp_equiv_p (p->exp, p->exp, 1, false))
continue;
+ /* If it's the same comparison we're already looking at, skip it. */
+ if (COMPARISON_P (p->exp)
+ && XEXP (p->exp, 0) == arg1
+ && XEXP (p->exp, 1) == arg2)
+ continue;
+
if (GET_CODE (p->exp) == COMPARE
/* Another possibility is that this machine has a compare insn
that includes the comparison code. In that case, ARG1 would
+2011-12-19 Sandra Loosemore <sandra@codesourcery.com>
+ Tom de Vries <tom@codesourcery.com>
+
+ PR rtl-opt/50380
+ * gcc.c-torture/compile/pr50380.c: New testcase.
+
2011-12-19 Tobias Burnus <burnus@net-b.de>
PR fortran/51605
--- /dev/null
+/* This test used to get stuck in an infinite loop in find_comparison_args
+ when compiling for MIPS at -O2. */
+
+__attribute__ ((__noreturn__)) extern void fail (void);
+
+char x;
+
+void foo (const unsigned char y)
+{
+ ((void) (__builtin_expect((!! y == y), 1) ? 0 : (fail (), 0)));
+ x = ! y;
+}