From patchwork Fri Jun 3 22:11:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 98663 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 0DAA2B6FB3 for ; Sat, 4 Jun 2011 08:11:50 +1000 (EST) Received: (qmail 7283 invoked by alias); 3 Jun 2011 22:11:47 -0000 Received: (qmail 7272 invoked by uid 22791); 3 Jun 2011 22:11:46 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Jun 2011 22:11:32 +0000 Received: from hpaq3.eem.corp.google.com (hpaq3.eem.corp.google.com [172.25.149.3]) by smtp-out.google.com with ESMTP id p53MBU0D026686; Fri, 3 Jun 2011 15:11:30 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by hpaq3.eem.corp.google.com with ESMTP id p53MBT2L015206; Fri, 3 Jun 2011 15:11:29 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 60BD31DA1CC; Fri, 3 Jun 2011 18:11:26 -0400 (EDT) To: reply@codereview.appspotmail.com, rguenther@suse.de, gcc-patches@gcc.gnu.org Subject: [lto] Unify testing for non-streamable nodes (issue4551094) Message-Id: <20110603221127.60BD31DA1CC@topo.tor.corp.google.com> Date: Fri, 3 Jun 2011 18:11:26 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) X-System-Of-Record: true 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 As discussed in http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00025.html, these assertions are no longer needed and they can be unified under lto_is_streamable (before converting it into a streamer hook). Tested with LTO profiledbootstrap on x86_64. Committed to trunk. Diego. * lto-streamer-in.c (unpack_value_fields): Remove unneeded asserts. (lto_input_tree_pointers): Likewise. * lto-streamer-out.c (pack_value_fields): Likewise. (lto_output_tree_pointers): Likewise. * lto-streamer.h (lto_is_streamable): Add check for OMP_CLAUSE and OPTIMIZATION_NODE. --- This patch is available for review at http://codereview.appspot.com/4551094 diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index a0c5509..3a5eb5a 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1839,24 +1839,6 @@ unpack_value_fields (struct bitpack_d *bp, tree expr) if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) unpack_ts_block_value_fields (bp, expr); - if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME)) - { - /* We only stream the version number of SSA names. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST)) - { - /* This is only used by GENERIC. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE)) - { - /* This is only used by High GIMPLE. */ - gcc_unreachable (); - } - if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL)) unpack_ts_translation_unit_decl_value_fields (bp, expr); } @@ -2408,38 +2390,15 @@ lto_input_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, if (CODE_CONTAINS_STRUCT (code, TS_EXP)) lto_input_ts_exp_tree_pointers (ib, data_in, expr); - if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME)) - { - /* We only stream the version number of SSA names. */ - gcc_unreachable (); - } - if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) lto_input_ts_block_tree_pointers (ib, data_in, expr); if (CODE_CONTAINS_STRUCT (code, TS_BINFO)) lto_input_ts_binfo_tree_pointers (ib, data_in, expr); - if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST)) - { - /* This should only appear in GENERIC. */ - gcc_unreachable (); - } - if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR)) lto_input_ts_constructor_tree_pointers (ib, data_in, expr); - if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE)) - { - /* This should only appear in High GIMPLE. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION)) - { - sorry ("optimization options not supported yet"); - } - if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION)) lto_input_ts_target_option (ib, expr); diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 3d42483..66b1ac6 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -589,24 +589,6 @@ pack_value_fields (struct bitpack_d *bp, tree expr) if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) pack_ts_block_value_fields (bp, expr); - if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME)) - { - /* We only stream the version number of SSA names. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST)) - { - /* This is only used by GENERIC. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE)) - { - /* This is only used by High GIMPLE. */ - gcc_unreachable (); - } - if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL)) pack_ts_translation_unit_decl_value_fields (bp, expr); } @@ -1251,12 +1233,6 @@ lto_output_tree_pointers (struct output_block *ob, tree expr, bool ref_p) if (CODE_CONTAINS_STRUCT (code, TS_EXP)) lto_output_ts_exp_tree_pointers (ob, expr, ref_p); - if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME)) - { - /* We only stream the version number of SSA names. */ - gcc_unreachable (); - } - if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) lto_output_ts_block_tree_pointers (ob, expr, ref_p); @@ -1266,21 +1242,6 @@ lto_output_tree_pointers (struct output_block *ob, tree expr, bool ref_p) if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR)) lto_output_ts_constructor_tree_pointers (ob, expr, ref_p); - if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST)) - { - /* This should only appear in GENERIC. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE)) - { - /* This should only appear in High GIMPLE. */ - gcc_unreachable (); - } - - if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION)) - sorry ("gimple bytecode streams do not support the optimization attribute"); - if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION)) lto_output_ts_target_option (ob, expr); diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 9de24ff..5f69655 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -1081,6 +1081,8 @@ lto_is_streamable (tree expr) && code != BIND_EXPR && code != WITH_CLEANUP_EXPR && code != STATEMENT_LIST + && code != OMP_CLAUSE + && code != OPTIMIZATION_NODE && (code == CASE_LABEL_EXPR || code == DECL_EXPR || TREE_CODE_CLASS (code) != tcc_statement);