From patchwork Thu Jul 1 22:54:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 57605 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 302ECB709F for ; Fri, 2 Jul 2010 08:54:32 +1000 (EST) Received: (qmail 32534 invoked by alias); 1 Jul 2010 22:54:28 -0000 Received: (qmail 32522 invoked by uid 22791); 1 Jul 2010 22:54:26 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Jul 2010 22:54:22 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 01 Jul 2010 15:54:21 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 01 Jul 2010 15:54:18 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id EA37E20393; Thu, 1 Jul 2010 15:54:18 -0700 (PDT) Date: Thu, 1 Jul 2010 15:54:18 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH: PR web/44775: union_match_dups failed to check NULL *ref Message-ID: <20100701225418.GA19170@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) 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 Hi, This patch adds check for NULL *ref. OK to install? Thanks. H.J. --- 2010-07-01 H.J. Lu PR web/44775 * web.c (union_match_dups): Check NULL *ref. diff --git a/gcc/web.c b/gcc/web.c index ff91733..4b2ce36 100644 --- a/gcc/web.c +++ b/gcc/web.c @@ -123,7 +123,8 @@ union_match_dups (rtx insn, struct web_entry *def_entry, if (DF_REF_LOC (*ref) == recog_data.operand_loc[op]) break; - (*fun) (use_entry + DF_REF_ID (*dupref), entry + DF_REF_ID (*ref)); + if (*ref) + (*fun) (use_entry + DF_REF_ID (*dupref), entry + DF_REF_ID (*ref)); } }