From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1571 invoked by alias); 19 May 2011 12:39:54 -0000 Received: (qmail 1560 invoked by uid 22791); 19 May 2011 12:39:51 -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 am1ehsobe003.messaging.microsoft.com (HELO AM1EHSOBE003.bigfish.com) (213.199.154.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 12:39:37 +0000 Received: from mail71-am1-R.bigfish.com (10.3.201.245) by AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id 14.1.225.22; Thu, 19 May 2011 12:39:34 +0000 Received: from mail71-am1 (localhost.localdomain [127.0.0.1]) by mail71-am1-R.bigfish.com (Postfix) with ESMTP id DA0731C90242 for ; Thu, 19 May 2011 12:39:34 +0000 (UTC) X-SpamScore: -3 X-BigFish: VPS-3(zz936eKzz1202hzz8275dhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:137.71.25.57;KIP:(null);UIP:(null);IPVD:NLI;H:nwd2mta2.analog.com;RD:nwd2mail11.analog.com;EFVD:NLI Received: from mail71-am1 (localhost.localdomain [127.0.0.1]) by mail71-am1 (MessageSwitch) id 1305808774766903_9350; Thu, 19 May 2011 12:39:34 +0000 (UTC) Received: from AM1EHSMHS010.bigfish.com (unknown [10.3.201.245]) by mail71-am1.bigfish.com (Postfix) with ESMTP id AC8844E804B for ; Thu, 19 May 2011 12:39:34 +0000 (UTC) Received: from nwd2mta2.analog.com (137.71.25.57) by AM1EHSMHS010.bigfish.com (10.3.207.110) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 19 May 2011 12:39:34 +0000 Received: from NWD2HUBCAS1.ad.analog.com (nwd2hubcas1.ad.analog.com [10.64.73.29]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id p4JCeUJd030607 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 19 May 2011 08:40:30 -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, 19 May 2011 08:39:33 -0400 Received: from LIMKCMBX1.ad.analog.com ([169.254.1.105]) by LimkHubCAS1.ad.analog.com ([10.32.51.140]) with mapi; Thu, 19 May 2011 13:39:11 +0100 From: "Henderson, Stuart" To: "gcc-patches@gcc.gnu.org" Date: Thu, 19 May 2011 13:08:00 -0000 Subject: Re: [PATCH] Fix PR target/48807 Message-ID: <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/msg01371.txt.bz2 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; }