From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10953 invoked by alias); 30 Jul 2007 14:37:52 -0000 Received: (qmail 10943 invoked by uid 22791); 30 Jul 2007 14:37:51 -0000 X-Spam-Check-By: sourceware.org Received: from pfepc.post.tele.dk (HELO pfepc.post.tele.dk) (195.41.46.237) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jul 2007 14:37:49 +0000 Received: from x1-6-00-0f-9f-c6-3e-90 (x1-6-00-0f-9f-c6-3e-90.k75.webspeed.dk [80.197.1.215]) by pfepc.post.tele.dk (Postfix) with ESMTP id A38FE8A0009 for ; Mon, 30 Jul 2007 16:37:46 +0200 (CEST) Received: from x1-6-00-0f-9f-c6-3e-90 (localhost.localdomain [127.0.0.1]) by x1-6-00-0f-9f-c6-3e-90 (8.14.0/8.14.0) with ESMTP id l6UEbjen011537 for ; Mon, 30 Jul 2007 16:37:45 +0200 Received: (from rask@localhost) by x1-6-00-0f-9f-c6-3e-90 (8.14.0/8.14.0/Submit) id l6UEbjPM011536 for gcc-patches@gcc.gnu.org; Mon, 30 Jul 2007 16:37:45 +0200 Date: Mon, 30 Jul 2007 15:08:00 -0000 From: Rask Ingemann Lambertsen To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/9] Fix reloads_unique_chain_p() missing a conflict Message-ID: <20070730143745.GM25795@sygehus.dk> References: <20070730134217.GK25795@sygehus.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070730134217.GK25795@sygehus.dk> User-Agent: Mutt/1.5.14 (2007-02-12) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg02112.txt.bz2 As discussed starting with this message , it is possible for reloads_unique_chain() to miss a reload conflict. It happens when two reloads are in a different other than expected. Reloads are sorted using target specific information and besides, the sorting is performed by qsort() which isn't guaranteed to be stable. The fix here is to check both reloads passed to reloads_unique_chain_p(). This and the other two reload patches in this patch set were bootstrapped and tested together on x86_64-unknown-linux-gnu with no new failures. I also built and tested cross compilers for arm-unknown-elf, cris-axis-elf, m32c-unknown-elf, mipsisa64-unknown-elf, sh-unknown-elf and v850-unknown-elf with no new failures. Ok for trunk? 2007-07-30 Rask Ingemann Lambertsen * reload1.c (reloads_unique_chain_p): Check both reloads. Index: gcc/reload1.c =================================================================== --- gcc/reload1.c (revision 126653) +++ gcc/reload1.c (working copy) @@ -4960,7 +4976,8 @@ reloads_unique_chain_p (int r1, int r2) if (i != r1 && i != r2 && rld[i].in) { /* If our reload is mentioned at all, it isn't a simple chain. */ - if (reg_mentioned_p (rld[r1].in, rld[i].in)) + if (reg_mentioned_p (rld[r1].in, rld[i].in) + || reg_mentioned_p (rld[r2].in, rld[i].in)) return false; } return true; -- Rask Ingemann Lambertsen