From 0b76eed807691ef39e9c7e37d662dd4a9362f412 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Wed, 8 Aug 2012 17:59:47 +0800 Subject: Backport fix to bug 50380: cc1 hangs eating 100% CPU This seems to affect MIPS GCC 4.6 only Change-Id: Idb1cf411396d909a40e1b6fcbfb5729879b6cf59 Related: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50380 http://gcc.gnu.org/viewcvs/trunk/gcc/cse.c?r1=177852&r2=182498&pathrev=182498 --- gcc-4.6/gcc/cse.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc-4.6/gcc/cse.c') diff --git a/gcc-4.6/gcc/cse.c b/gcc-4.6/gcc/cse.c index 078977fbc..760911424 100644 --- a/gcc-4.6/gcc/cse.c +++ b/gcc-4.6/gcc/cse.c @@ -3054,6 +3054,12 @@ find_comparison_args (enum rtx_code code, rtx *parg1, rtx *parg2, 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 -- cgit v1.2.3