From patchwork Tue Oct 2 18:56:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 188618 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 A28F12C00A9 for ; Wed, 3 Oct 2012 04:57:20 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349809040; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:From:To:Subject:Date:Message-ID: User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Z96n1X6/ahqiofZ4PRT8kjPuqpk=; b=ekVvxt7B0TxjljU WfxEXgpIwKHKtghOnBzTfiubjyp7um9rw/EZU3EBTlbS4a2Q2FRKmjXWtrmE8bLd p0lyuQeoU4jFuYykoJlzplALAGS97Zox9Yy4ZKL8cNsoYrP82UF9wAjOmNQSQ9iu 85+rxZ9ja4k9Z1zt7CeExBdb4ias= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ngtBO8ualakA/MASoGmwfYeGzUl4T8ncJeK4m/4ke+n0BMk1/ORWjmRkbTk49n vlttpUv1f6VEteT9CEst+O5kq2zUbyUl+5ac7wCKyjrdj7OqqbiBVbU4pUZZAABS a+LYj1WbhGvDhrgYdvd6EpFjKSJn/f1tYPMMRIJ3zbvYQ=; Received: (qmail 1958 invoked by alias); 2 Oct 2012 18:57:17 -0000 Received: (qmail 1811 invoked by uid 22791); 2 Oct 2012 18:57:16 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Oct 2012 18:57:07 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q92Iv58q025487 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Oct 2012 14:57:05 -0400 Received: from freie (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q92Iv3xV004653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Oct 2012 14:57:05 -0400 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie (8.14.5/8.14.5) with ESMTP id q92Iv0RB007628 for ; Tue, 2 Oct 2012 15:57:00 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q92Iv0qP011112; Tue, 2 Oct 2012 15:57:00 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q92IuxH1011109; Tue, 2 Oct 2012 15:56:59 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [PR54177] Deal with var_lowpart failure in function parameters Date: Tue, 02 Oct 2012 15:56:58 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 Uros has already taken care of the main patch for the problem, but I feel it's appropriate to protect vt_add_function_parameter should val_lowpart actually return NULL. I'm checking this in as obvious. Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Deal with var_lowpart failure in function parameters. From: Alexandre Oliva for gcc/ChangeLog * var-tracking.c (vt_add_function_parameter): Bail if var_lowpart fails. --- gcc/var-tracking.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 9f5bc12..bbd2f4b 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -9428,6 +9428,7 @@ vt_add_function_parameter (tree parm) && GET_CODE (incoming) != PARALLEL) { cselib_val *val; + rtx lowpart; /* ??? We shouldn't ever hit this, but it may happen because arguments passed by invisible reference aren't dealt with @@ -9436,7 +9437,11 @@ vt_add_function_parameter (tree parm) if (offset) return; - val = cselib_lookup_from_insn (var_lowpart (mode, incoming), mode, true, + lowpart = var_lowpart (mode, incoming); + if (!lowpart) + return; + + val = cselib_lookup_from_insn (lowpart, mode, true, VOIDmode, get_insns ()); /* ??? Float-typed values in memory are not handled by