From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16989 invoked by alias); 26 May 2011 10:29:59 -0000 Received: (qmail 16978 invoked by uid 22791); 26 May 2011 10:29:58 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from va3ehsobe002.messaging.microsoft.com (HELO VA3EHSOBE002.bigfish.com) (216.32.180.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 May 2011 10:29:42 +0000 Received: from mail27-va3-R.bigfish.com (10.7.14.239) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 14.1.225.22; Thu, 26 May 2011 10:29:41 +0000 Received: from mail27-va3 (localhost.localdomain [127.0.0.1]) by mail27-va3-R.bigfish.com (Postfix) with ESMTP id 2E5DEA9012E for ; Thu, 26 May 2011 10:29:41 +0000 (UTC) X-SpamScore: -8 X-BigFish: VPS-8(zz936eK542Mzz1202hzz8275dhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:137.71.25.55;KIP:(null);UIP:(null);IPVD:NLI;H:nwd2mta1.analog.com;RD:nwd2mail10.analog.com;EFVD:NLI Received: from mail27-va3 (localhost.localdomain [127.0.0.1]) by mail27-va3 (MessageSwitch) id 1306405779969069_13700; Thu, 26 May 2011 10:29:39 +0000 (UTC) Received: from VA3EHSMHS017.bigfish.com (unknown [10.7.14.251]) by mail27-va3.bigfish.com (Postfix) with ESMTP id E96D73A8051 for ; Thu, 26 May 2011 10:29:39 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by VA3EHSMHS017.bigfish.com (10.7.99.27) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 26 May 2011 10:29:37 +0000 Received: from NWD2HUBCAS1.ad.analog.com (nwd2hubcas1.ad.analog.com [10.64.73.29]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id p4QATY47013919 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 26 May 2011 06:29:34 -0400 Received: from LimkHubCAS1.ad.analog.com (10.32.51.140) by NWD2HUBCAS1.ad.analog.com (10.64.73.29) with Microsoft SMTP Server (TLS) id 8.1.358.0; Thu, 26 May 2011 06:29:36 -0400 Received: from LIMKCMBX1.ad.analog.com ([169.254.1.105]) by LimkHubCAS1.ad.analog.com ([10.32.51.140]) with mapi; Thu, 26 May 2011 11:29:34 +0100 From: "Henderson, Stuart" To: "gcc-patches@gcc.gnu.org" Date: Thu, 26 May 2011 11:02:00 -0000 Subject: RE: [PATCH] Fix PR target/48807 Message-ID: <05E9E85E39C35B4D96ED3A3190E35A10A49CE777EC@LIMKCMBX1.ad.analog.com> References: <05E9E85E39C35B4D96ED3A3190E35A10A49CDA1888@LIMKCMBX1.ad.analog.com> In-Reply-To: <05E9E85E39C35B4D96ED3A3190E35A10A49CDA1888@LIMKCMBX1.ad.analog.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: analog.com X-IsSubscribed: yes 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: 2011-05/txt/msg01990.txt.bz2 Ping Ping. -----Original Message----- From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-owner@gcc.gnu.org] = On Behalf Of Henderson, Stuart Sent: 19 May 2011 13:39 To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR target/48807 Ping http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00503.html Hi, The attached patch is a fix for PR/48807, which is a segfault when compilin= g the bfin compiler. The problem appears to be that we're not checking the= return value of cgraph_local_info for null before attempting to dereferenc= e it. This wasn't a problem before, but now cgraph_local_info calls cgraph= _get_node (instead of the old cgraph_node), we cannot assume it will always= return non-null. Fix is in bfin specific code. Ok to commit to trunk? Stu 2011-05-06 Stuart Henderson * config/bfin/bfin.c: Check return value of cgraph_local_info for null = before attempting to use it. Index: gcc/config/bfin/bfin.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/config/bfin/bfin.c (revision 173363) +++ gcc/config/bfin/bfin.c (working copy) @@ -2077,6 +2077,8 @@ this_func =3D cgraph_local_info (current_function_decl); called_func =3D cgraph_local_info (decl); + if (!called_func || !this_func) + return false; return !called_func->local || this_func->local; }