From patchwork Wed Aug 18 08:30:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Belevantsev X-Patchwork-Id: 62012 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 544C6B70D8 for ; Wed, 18 Aug 2010 18:30:54 +1000 (EST) Received: (qmail 8738 invoked by alias); 18 Aug 2010 08:30:51 -0000 Received: (qmail 8715 invoked by uid 22791); 18 Aug 2010 08:30:49 -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 smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 08:30:42 +0000 Received: from [10.10.3.52] (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with ESMTP id EE3355D40CD; Wed, 18 Aug 2010 10:46:23 +0400 (MSD) Message-ID: <4C6B9A2F.4090805@ispras.ru> Date: Wed, 18 Aug 2010 12:30:39 +0400 From: Andrey Belevantsev User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: GCC Patches CC: "Vladimir N. Makarov" Subject: [PATCH] Fix PR 44691 X-IsSubscribed: yes 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 Hello, As explained in the audit trail, the problem was that in the selective scheduler I assumed that SUBREG_REG will always be a REG, which seems to be not the case. This is not quite in line with what documentation says, if I read it correctly, but it seems to be used in a number of backends, so the below patch just gives up substitution also when SUBREG_REG is not a register. Bootstrapped and tested on ia64, and verified that the test is fixed on x86_64. I think that this qualifies as obvious, so unless Vlad or other people have any comments, I'll commit it tomorrow. Yours, Andrey 2010-08-18 Andrey Belevantsev PR rtl-optimization/44691 * sel-sched.c (count_occurrences_1): Also punt when SUBREG_REG is not a register. Index: gcc/sel-sched.c =================================================================== *** gcc/sel-sched.c (revision 163192) --- gcc/sel-sched.c (working copy) *************** count_occurrences_1 (rtx *cur_rtx, void *** 835,841 **** if (GET_CODE (*cur_rtx) == SUBREG && REG_P (p->x) ! && REGNO (SUBREG_REG (*cur_rtx)) == REGNO (p->x)) { /* ??? Do not support substituting regs inside subregs. In that case, simplify_subreg will be called by validate_replace_rtx, and --- 835,842 ---- if (GET_CODE (*cur_rtx) == SUBREG && REG_P (p->x) ! && (!REG_P (SUBREG_REG (*cur_rtx)) ! || REGNO (SUBREG_REG (*cur_rtx)) == REGNO (p->x))) { /* ??? Do not support substituting regs inside subregs. In that case, simplify_subreg will be called by validate_replace_rtx, and