From patchwork Sat Jun 1 00:28:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 248041 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id B077F2C0097 for ; Sat, 1 Jun 2013 10:28:56 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=ngs 1tHvJp0BMgUxUy9GljwKW5vqADb+GnfwWllO7LtQPqjcnsEPO378eTc2uzaYwY8a /rY9CpdiztU7AQb6e4Het+e4EmTv2zGWfAa7GnCUSiadyTLW4R6fSocYH9ySvR4Y KvOR/JoBAQ+a/rYyK3EeeOw5/yU8/oHBE7J2QLnk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=OxexTs8o8 hQNy9WgbGcjAoC7C3s=; b=uhU8gx34EX7t51q2XTRNlqCs9uVNOvIm3rP1N+Ozj e6LmI/x1TrDxJTUY6sTl9oFUY1Vc7UF4FKMPdzvmn5iYJAWeaQPOU+/n5LVwO0Vo 21MGQm9lpsvMLzxgzHZoxViK5OPKRjAv7pSjF947Rm9ajCZfrzZ2o57RA9rm4xuz P4= Received: (qmail 9864 invoked by alias); 1 Jun 2013 00:28:50 -0000 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 Received: (qmail 9808 invoked by uid 89); 1 Jun 2013 00:28:43 -0000 X-Spam-SWARE-Status: No, score=-5.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.1 Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 01 Jun 2013 00:28:43 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 31 May 2013 17:28:41 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34]) by azsmga001.ch.intel.com with ESMTP; 31 May 2013 17:28:41 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 31 May 2013 17:28:40 -0700 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.135]) by FMSMSX112.amr.corp.intel.com ([169.254.3.191]) with mapi id 14.03.0123.003; Fri, 31 May 2013 17:28:41 -0700 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" CC: "dominiq@lps.ens.fr" Subject: [PATCH] fix for pr 57474 Date: Sat, 1 Jun 2013 00:28:40 +0000 Message-ID: MIME-Version: 1.0 Hello Everyone, PR reports that sec_implicit2 and sec_implicit regression tests were failing in darwin. I looked into it and it is due to an uninitialized variable (rhs_length). This patch pasted below should fix that issue. Is this OK for trunk? Here are the ChangeLog entries: 2013-05-31 Balaji V. Iyer PR c/57474 * c-array-notation.c (build_array_notation_expr): Initialized rhs_length array to NULL_TREE if they are unused. Also added a check for the field to be NULL before its fields are used in future. Here is the patch: Thanks, Balaji V. Iyer. diff --git gcc/c/c-array-notation.c gcc/c/c-array-notation.c index 5376e6b..7fbd573 100644 --- gcc/c/c-array-notation.c +++ gcc/c/c-array-notation.c @@ -1547,7 +1547,10 @@ build_array_notation_expr (location_t location, tree lhs, tr } else for (jj = 0; jj < rhs_rank; jj++) - rhs_vector[ii][jj] = false; + { + rhs_vector[ii][jj] = false; + rhs_length[ii][jj] = NULL_TREE; + } } if (length_mismatch_in_expr_p (EXPR_LOCATION (lhs), lhs_length, @@ -1561,6 +1564,7 @@ build_array_notation_expr (location_t location, tree lhs, tre if (lhs_list_size > 0 && rhs_list_size > 0 && lhs_rank > 0 && rhs_rank > 0 && TREE_CODE (lhs_length[0][0]) == INTEGER_CST + && rhs_length[0][0] && TREE_CODE (rhs_length[0][0]) == INTEGER_CST) { HOST_WIDE_INT l_length = int_cst_value (lhs_length[0][0]);