From patchwork Fri May 27 08:14:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 97661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 98D4AB6F8D for ; Fri, 27 May 2011 18:14:43 +1000 (EST) Received: (qmail 12744 invoked by alias); 27 May 2011 08:14:40 -0000 Received: (qmail 12732 invoked by uid 22791); 27 May 2011 08:14:38 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 May 2011 08:14:25 +0000 Received: (qmail 27409 invoked from network); 27 May 2011 08:14:24 -0000 Received: from unknown (HELO ?84.152.188.110?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 May 2011 08:14:24 -0000 Message-ID: <4DDF5D5B.2090707@codesourcery.com> Date: Fri, 27 May 2011 08:14:19 +0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: GCC Patches Subject: Sched patch: better condition mutex testing Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org When regrename is enabled, it makes new copies of its replacement registers, which means that pointer equality tests can't be used afterwards to check whether two regs are equal. sched_insn_conditions_mutex_p has one such test, and it causes pessimized code in some situations on C6X. The following patch fixes it. Regression tested with a 4.5 c6x-elf compiler. I tried to bootstrap ia64, but that has PR48496. Ok? Bernd * sched-deps.c (conditions_mutex_p): Use rtx_equal_p to compare registers. Index: gcc/sched-deps.c =================================================================== --- gcc/sched-deps.c (revision 325327) +++ gcc/sched-deps.c (working copy) @@ -563,7 +563,7 @@ conditions_mutex_p (const_rtx cond1, con (rev1==rev2 ? reversed_comparison_code (cond2, NULL) : GET_CODE (cond2)) - && XEXP (cond1, 0) == XEXP (cond2, 0) + && rtx_equal_p (XEXP (cond1, 0), XEXP (cond2, 0)) && XEXP (cond1, 1) == XEXP (cond2, 1)) return 1; return 0;