From patchwork Wed Jun 20 03:39:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 165871 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 95F1AB7017 for ; Wed, 20 Jun 2012 13:40:07 +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=1340768408; 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=Utaxz3AU96PukMZpBAYA7Mkw6TI=; b=wQsnMLzUQqLpbBj pzCeHM1JX/pWo80fKymYE/OtdH89hSR9pd3m5VDe+ZygGZKOAYM3tb6PJb+6V+Dp CLtgVn0Njhj26M9zNBuSitsVubJWP3UUl2vElTd0lJ4vV0RKVokoO7gEpkjg1vFI AAV21ttMHy/1XXghAB9yk3IJTsjA= 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=yleyoaqEnNT/Vi+Z6GZmT827lRC8pGZnE8Sk6pmjtQb9IjGap+1nFJoKNUNqI4 rPfaditbOaAJ12d9wRyAmtafRFP0OHLAfy+HAx6us0KslBzu+IEDi8KDyze9FcU2 ES3x63q/rAb8FXdVI/u0clQYQDySXkUrETuV7f8fQD9uc=; Received: (qmail 29321 invoked by alias); 20 Jun 2012 03:39:59 -0000 Received: (qmail 29240 invoked by uid 22791); 20 Jun 2012 03:39:58 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, 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; Wed, 20 Jun 2012 03:39:42 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5K3dcUm006161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 19 Jun 2012 23:39:38 -0400 Received: from freie (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5K3daeC020483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Jun 2012 23:39:38 -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 q5K3dZqZ029099 for ; Wed, 20 Jun 2012 00:39:35 -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 q5K3dYVk005745; Wed, 20 Jun 2012 00:39:34 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q5K3dUNr005743; Wed, 20 Jun 2012 00:39:30 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [PR debug/53682] avoid crash in cselib promote_debug_loc Date: Wed, 20 Jun 2012 00:39:29 -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 When promote_debug_loc was first introduced, it would never be called with a NULL loc list. However, because of the strategy of temporarily resetting loc lists before recursion introduced a few months ago in alias.c, the earlier assumption no longer holds. This patch adusts promote_debug_loc to deal with this case. Ok to install? for gcc/ChangeLog from Alexandre Oliva PR debug/53682 * cselib.c (promote_debug_loc): Don't crash on NULL argument. Index: gcc/cselib.c =================================================================== --- gcc/cselib.c.orig 2012-06-17 22:52:27.740087279 -0300 +++ gcc/cselib.c 2012-06-18 08:55:32.948832112 -0300 @@ -322,7 +322,7 @@ new_elt_loc_list (cselib_val *val, rtx l static inline void promote_debug_loc (struct elt_loc_list *l) { - if (l->setting_insn && DEBUG_INSN_P (l->setting_insn) + if (l && l->setting_insn && DEBUG_INSN_P (l->setting_insn) && (!cselib_current_insn || !DEBUG_INSN_P (cselib_current_insn))) { n_debug_values--;