From patchwork Thu Nov 15 21:54:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 199433 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 050252C0384 for ; Fri, 16 Nov 2012 08:56:11 +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=1353621372; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Date:To:Subject:User-Agent: MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=V4IKym0 hm5JHQ6QKD4rcEUPHQpE=; b=Psd40jSUp9+KKyc6nvsuZCtDODKdwB2CMwscYnc +pUkH0uABKFpCOcw7OV8SPGgpR/hxucoi2v9Hemj/4JGTZ4uFJeIBsTQWVMEcd+c eqF/sRLd/NB4VDHy9+JMEJMOgaObKE22KEV5KcOqwpOMk6p7bB9HOsUQi9TgXBFP V9vk= 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-Google-DKIM-Signature:Received:Received:Received:Received:Date:To:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=lu4alYaZhrc7r9+GP5RD3IBn7RHeSIYYO4edN2bpq9vEYbYDxndFP5Z7AzOE4Y FF7jvaA74+h2pDjfHGwV/RMRa3LNsLMXsw+tF0hFvhxM5Frlw5746VjDz2BZ7QdI Wk+ZmxtW79FQ/1NkdNz9gTsP924JoQma0Abn64aq2C7aw=; Received: (qmail 10750 invoked by alias); 15 Nov 2012 21:54:18 -0000 Received: (qmail 10678 invoked by uid 22791); 15 Nov 2012 21:54:16 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_FN X-Spam-Check-By: sourceware.org Received: from mail-fa0-f73.google.com (HELO mail-fa0-f73.google.com) (209.85.161.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 21:54:05 +0000 Received: by mail-fa0-f73.google.com with SMTP id a10so2928fad.2 for ; Thu, 15 Nov 2012 13:54:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:to:subject:user-agent:mime-version:content-type :content-transfer-encoding:message-id:from:x-gm-message-state; bh=yhN8RYk96TVMuxQts8VkLs5B4RHS+1mzxK0QkpgbFgE=; b=AIOKnEbX/36YmrfdKsq6j9U0FORsb1ofAY3EMYe09Nuk3M/qgU3pU8YSJb8ROB3j1d QPVlWTYIu0NlelmIxc5WheZnwMqjwUTvhfDSEYXNtO7loKVXWnqDOIdRxcoMDVgiFcd+ HQN4LK4+iX01wkPbDVHd9cHdPCkdulnO+cND4LNatkv8XUdY47Caboww23QNHPpMd54f SGv4UK6vU72fk7Cly6Rul2GmLDAo0ThqsSpI3HZi5XCK5mytxzvqpfuXz33LXYmteYlg 2NzNk9rDHmsE04mPpn4R+Xbe9MOKLUcOJh6592mVsMc3rJ2HNBN2tKGovS/YkdR9FSkQ xEgw== Received: by 10.14.209.66 with SMTP id r42mr3311287eeo.1.1353016444011; Thu, 15 Nov 2012 13:54:04 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si4117178een.1.2012.11.15.13.54.03 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 15 Nov 2012 13:54:04 -0800 (PST) Received: from torture.tor.corp.google.com (torture.tor.corp.google.com [172.30.222.16]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id A3495200078; Thu, 15 Nov 2012 13:54:03 -0800 (PST) Received: by torture.tor.corp.google.com (Postfix, from userid 54752) id 1381BC0916; Thu, 15 Nov 2012 16:54:02 -0500 (EST) Date: Thu, 15 Nov 2012 16:54:02 -0500 To: rth@redhat.com, gcc-patches@gcc.gnu.org Subject: VEC re-write [patch 15/25] User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20121115215403.1381BC0916@torture.tor.corp.google.com> From: dnovillo@google.com (Diego Novillo) X-Gm-Message-State: ALoCoQkdFtQrqw2RfZIff0D3/9Rnl5xG4M2ZwSnW5S7WG4IomlOCtRNjwbys8WC1a9WAlMH8RLl4Co/YamIU4+rt+zZP5VcfJ8KUw1q4zSea86rClVMrYUSo8mp8muO6kgR81M1FNKHiE8pJS04c8mURPF3SAH5HnTHPDrroA7dZ1AB7IAYelc9lq5eYj+oBGtii4o8gLs/UVdaqSe1YKVfX2vdTOZGpzWUiWXglvbLp5sOq4PgeB+M= X-IsSubscribed: yes 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 2012-11-15 Diego Novillo Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * config/i386/i386.c: Use new vec API in vec.h. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c295849..fc0ba9b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -28620,7 +28620,7 @@ dispatch_function_versions (tree dispatch_decl, gimple_seq gseq; int ix; tree ele; - VEC (tree, heap) *fndecls; + vec *fndecls; unsigned int num_versions = 0; unsigned int actual_versions = 0; unsigned int i; @@ -28637,17 +28637,17 @@ dispatch_function_versions (tree dispatch_decl, && empty_bb != NULL); /*fndecls_p is actually a vector. */ - fndecls = (VEC (tree, heap) *)fndecls_p; + fndecls = static_cast *> (fndecls_p); /* At least one more version other than the default. */ - num_versions = VEC_length (tree, fndecls); + num_versions = fndecls->length (); gcc_assert (num_versions >= 2); function_version_info = (struct _function_version_info *) XNEWVEC (struct _function_version_info, (num_versions - 1)); /* The first version in the vector is the default decl. */ - default_decl = VEC_index (tree, fndecls, 0); + default_decl = (*fndecls)[0]; push_cfun (DECL_STRUCT_FUNCTION (dispatch_decl)); @@ -28655,7 +28655,7 @@ dispatch_function_versions (tree dispatch_decl, /* Function version dispatch is via IFUNC. IFUNC resolvers fire before constructors, so explicity call __builtin_cpu_init here. */ ifunc_cpu_init_stmt = gimple_build_call_vec ( - ix86_builtins [(int) IX86_BUILTIN_CPU_INIT], NULL); + ix86_builtins [(int) IX86_BUILTIN_CPU_INIT], vec()); gimple_seq_add_stmt (&gseq, ifunc_cpu_init_stmt); gimple_set_bb (ifunc_cpu_init_stmt, *empty_bb); set_bb_seq (*empty_bb, gseq); @@ -28663,7 +28663,7 @@ dispatch_function_versions (tree dispatch_decl, pop_cfun (); - for (ix = 1; VEC_iterate (tree, fndecls, ix, ele); ++ix) + for (ix = 1; fndecls->iterate (ix, &ele); ++ix) { tree version_decl = ele; tree predicate_chain = NULL_TREE; @@ -29159,7 +29159,7 @@ ix86_generate_version_dispatcher_body (void *node_p) { tree resolver_decl; basic_block empty_bb; - VEC (tree, heap) *fn_ver_vec = NULL; + vec fn_ver_vec = vec(); tree default_ver_decl; struct cgraph_node *versn; struct cgraph_node *node; @@ -29189,7 +29189,7 @@ ix86_generate_version_dispatcher_body (void *node_p) push_cfun (DECL_STRUCT_FUNCTION (resolver_decl)); - fn_ver_vec = VEC_alloc (tree, heap, 2); + fn_ver_vec.create (2); for (versn_info = node_version_info->next; versn_info; versn_info = versn_info->next) @@ -29203,10 +29203,10 @@ ix86_generate_version_dispatcher_body (void *node_p) if (DECL_VINDEX (versn->symbol.decl)) error_at (DECL_SOURCE_LOCATION (versn->symbol.decl), "Virtual function multiversioning not supported"); - VEC_safe_push (tree, heap, fn_ver_vec, versn->symbol.decl); + fn_ver_vec.safe_push (versn->symbol.decl); } - dispatch_function_versions (resolver_decl, fn_ver_vec, &empty_bb); + dispatch_function_versions (resolver_decl, &fn_ver_vec, &empty_bb); rebuild_cgraph_edges (); pop_cfun ();