From patchwork Tue Mar 20 00:27:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 147700 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 F1A41B6EEF for ; Tue, 20 Mar 2012 11:27:37 +1100 (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=1332808058; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:Content-Type: MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=ugAqRFH pYatZOHDdvO1tmmHlKao=; b=wnQinRB2xlcbPZIHjTva6e8oQWM4R/8vWurN6ce imcnQ3JurWJcaT3GnQFT2hxJse/EHckPCX4RdS/inwHosQ9vm5FrMVr7Y7Dsg8Ga Bq/bF6PbkLJuhyunhE6IJTh1ZswsRj9gy2EO5QOVcqOCIrihl9YRWWWaC1DH1iqU cUSA= 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:X-ExtLoop1:Received:Received:Received:From:To:Subject:Date:Message-ID:Content-Type:MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=asHdwH8yaLzvEbTA3RBbjb7Pty6XrlkKHMrMmDdCU50wWkK3IyvRp23Utq4pX9 psllYQkmaQbymFRG+NV1XqIiRSzK3jqoz2q7T3iqvV9g8Yo61EVLkDXYwKtelXy/ BSHynv2Fpx2XyU9RIMmpS5CbUvpAOnZugjtiI0I+Rt344=; Received: (qmail 24302 invoked by alias); 20 Mar 2012 00:27:31 -0000 Received: (qmail 24278 invoked by uid 22791); 20 Mar 2012 00:27:29 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Mar 2012 00:27:07 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 19 Mar 2012 17:27:07 -0700 X-ExtLoop1: 1 Received: from azsmsx601.amr.corp.intel.com ([10.2.121.193]) by azsmga001.ch.intel.com with ESMTP; 19 Mar 2012 17:27:07 -0700 Received: from fmsmsx108.amr.corp.intel.com (10.19.9.228) by azsmsx601.amr.corp.intel.com (10.2.121.193) with Microsoft SMTP Server (TLS) id 8.2.255.0; Mon, 19 Mar 2012 17:27:06 -0700 Received: from fmsmsx102.amr.corp.intel.com ([169.254.2.186]) by FMSMSX108.amr.corp.intel.com ([169.254.10.241]) with mapi id 14.01.0355.002; Mon, 19 Mar 2012 17:27:06 -0700 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][Cilkplus, Cilkplus-4_7-branch] Patch to fix a elemental function bug Date: Tue, 20 Mar 2012 00:27:05 +0000 Message-ID: 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 Hello Everyone, This patch is for the Cilkplus and Cilkplus-4_7-branch affecting mainly the C compiler. it will fix a crash when a default vector length or processor name is not given. Thanks, Balaji V. Iyer. diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index b2d90e0..35f052f 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,3 +1,9 @@ +2012-03-19 Balaji V. Iyer + + * elem-function.c (find_processor_code): Returned default value when + no value is given. + (find_vlength_code): Likewise. + 2012-03-18 Balaji V. Iyer * c-array-notation.c (expand_array_notation_exprs): New function. diff --git a/gcc/elem-function.c b/gcc/elem-function.c index a5a7b61..b1bb22e 100644 --- a/gcc/elem-function.c +++ b/gcc/elem-function.c @@ -136,7 +136,7 @@ static char * find_processor_code (elem_fn_info *elem_fn_values) { if (!elem_fn_values || !elem_fn_values->proc_type) - return NULL; + return xstrdup ("B"); if (!strcmp (elem_fn_values->proc_type, "pentium_4")) return xstrdup ("B"); @@ -161,7 +161,7 @@ find_vlength_code (elem_fn_info *elem_fn_values) { char *vlength_code = (char *) xmalloc (sizeof (char) * 10); if (!elem_fn_values) - return NULL; + return sprintf (vlength_code, "4"); memset (vlength_code, 10, 0); @@ -170,7 +170,7 @@ find_vlength_code (elem_fn_info *elem_fn_values) else { if (!strcmp (elem_fn_values->proc_type, "pentium_4")) - sprintf(vlength_code,"4"); + sprintf (vlength_code,"4"); else if (!strcmp (elem_fn_values->proc_type, "pentium4_sse3")) sprintf (vlength_code, "4"); else if (!strcmp (elem_fn_values->proc_type, "core2_duo_ssse3"))