From patchwork Fri Oct 4 16:43:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 280673 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 did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 48B042C00A7 for ; Sat, 5 Oct 2013 02:43:58 +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 :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=SAqw1+TBy4EiT1cL8ejmEjPcY6DgpnyvjvL6YzNewgsJA8 odt/2nOiDLHLr31n8xu7VogFGEok4bqKiGnrBLKYIc3E6JIT5WXsmolKRAFYPY7e YIfrOv2BSn0aO/kJb1IeQGnqn7PW9DgqYXA83MqELa0MyvJkkTjLw51kgEbrA= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=2OP2RV2vzvHep8e3XAuUt1lhJvg=; b=GmDDGMJoozZOES52c6xG Q2wR0ZYmfC2G2bi0KPTF2aHq4V9Thz1iVtm25L+vXlcZCVPA9WdPV7gRpw3t2tQr kV9nm7Ruk+XM9bopwnUnb0VkDJ7ZkVzPNUabc/E5taaS/AOQ5oYSYl268L/3V3uG xEnw1wnlscoIOQFa+KSwJIU= Received: (qmail 24039 invoked by alias); 4 Oct 2013 16:43:52 -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 24026 invoked by uid 89); 4 Oct 2013 16:43:51 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Oct 2013 16:43:51 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED, AWL, BAYES_50, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r94Ghkae005340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Oct 2013 12:43:46 -0400 Received: from [10.10.54.8] (vpn-54-8.rdu2.redhat.com [10.10.54.8]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r94GhiwH023740; Fri, 4 Oct 2013 12:43:45 -0400 Message-ID: <524EF040.9020702@redhat.com> Date: Fri, 04 Oct 2013 12:43:44 -0400 From: Andrew MacLeod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: gcc-patches , Richard Biener , Diego Novillo Subject: [patch] Relocate remaining tree-flow-inline.h functions X-IsSubscribed: yes This patch mostly re-factors tree-flow-inline.h out of existence. the gimple-df data structure has found anew home in gimple-ssa.h, and this actually seems like a very appropriate place for it as it holds a lot fo the ssa specific stuff in it. The remaining inline functions in tree-flow-inline.h are spread to the wind a bit. - 2 were no longer used, s they are deleted. - The various stmt_uid functions went to gimple.h, along with some stats macros and misc stuff. didn't seem to be a more appropriate place right now based on their usage patterns. - tree-hasher.h was including tree-flow.h simply to get the definition of 'struct int_tree_map'. man. Its a hash table function only, so it belongs here. - contains_view_convert_expr_p was only called from tree-sra.c, so I moved it there and made it static. - ranges_overlap_p .. this was used almost exclusively by SSA aliasing code, so this seemed appropriate for tree-ssa-alias.h. - gimple_ssa_operands goes to tree-ssa-operands.c and becomes static as this was the only consumer - is_global_var and may_be_aliased are tree specific.. may_be_aliased is used by dse.c, and by putting it into tree.c, that file is tantalizing close to being able to NOT include tree-ssa.h or any gimple stuff.. local_variable_can_escape() is the only routine in there that is even aware of ssa or gimple and something seems wrong there. thats on my list to take care of shortly. Bootstraps on x86_64-unknown-linux-gnu and no new regressions. OK? Andrew * tree-flow.h (tm_restart_node, gimple_df): Move to gimple-ssa.h. (struct int_tree_map): Move to tree-hasher.h (SCALE, LABEL, PERCENT): Move to gimple.h * tree-flow-inline.h: Delete. Move functions to other files. (unmodifiable_var_p, ref_contains_array_ref): Unused, so delete. * gimple-ssa.h (tm_restart_node, gimple_df): Relocate from tree-flow.h. (gimple_in_ssa_p, gimple_vop): Relocate from tree-flow-inline.h * gimple.h (imple_stmt_max_uid, set_gimple_stmt_max_uid, inc_gimple_stmt_max_uid, get_lineno): Relocate from tree-flow-inline.h. (SCALE, LABEL, PERCENT): Relocate from tree-flow.h * tree-hasher.h: Don't include tree-flow.h. (struct int_tree_map): Relocate from tree-flow.h. * tree-sra.c (contains_view_convert_expr_p): Relocate from tree-flow-inline.h and make static. * tree-ssa-alias.h (ranges_overlap_p): Relocate from tree-flow-inline.h. * tree-ssa-operands.c (gimple_ssa_operands): Relocate from tree-flow-inline.h and make static. * tree.h (is_global_var, may_be_aliased): Relocate from tree-flow-inline.h. * Makefile.in (GTFILES): Remove tree-flow.h and add gimple-ssa.h. Index: tree-flow.h =================================================================== *** tree-flow.h (revision 203148) --- tree-flow.h (working copy) *************** along with GCC; see the file COPYING3. *** 36,122 **** #include "gimple-low.h" #include "tree-into-ssa.h" - /* This structure is used to map a gimple statement to a label, - or list of labels to represent transaction restart. */ - - struct GTY(()) tm_restart_node { - gimple stmt; - tree label_or_list; - }; - - /* Gimple dataflow datastructure. All publicly available fields shall have - gimple_ accessor defined in tree-flow-inline.h, all publicly modifiable - fields should have gimple_set accessor. */ - struct GTY(()) gimple_df { - /* A vector of all the noreturn calls passed to modify_stmt. - cleanup_control_flow uses it to detect cases where a mid-block - indirect call has been turned into a noreturn call. When this - happens, all the instructions after the call are no longer - reachable and must be deleted as dead. */ - vec *modified_noreturn_calls; - - /* Array of all SSA_NAMEs used in the function. */ - vec *ssa_names; - - /* Artificial variable used for the virtual operand FUD chain. */ - tree vop; - - /* The PTA solution for the ESCAPED artificial variable. */ - struct pt_solution escaped; - - /* A map of decls to artificial ssa-names that point to the partition - of the decl. */ - struct pointer_map_t * GTY((skip(""))) decls_to_pointers; - - /* Free list of SSA_NAMEs. */ - vec *free_ssanames; - - /* Hashtable holding definition for symbol. If this field is not NULL, it - means that the first reference to this variable in the function is a - USE or a VUSE. In those cases, the SSA renamer creates an SSA name - for this variable with an empty defining statement. */ - htab_t GTY((param_is (union tree_node))) default_defs; - - /* True if there are any symbols that need to be renamed. */ - unsigned int ssa_renaming_needed : 1; - - /* True if all virtual operands need to be renamed. */ - unsigned int rename_vops : 1; - - /* True if the code is in ssa form. */ - unsigned int in_ssa_p : 1; - - /* True if IPA points-to information was computed for this function. */ - unsigned int ipa_pta : 1; - - struct ssa_operands ssa_operands; - - /* Map gimple stmt to tree label (or list of labels) for transaction - restart and abort. */ - htab_t GTY ((param_is (struct tm_restart_node))) tm_restart; - }; - - static inline int get_lineno (const_gimple); - - /*--------------------------------------------------------------------------- - Global declarations - ---------------------------------------------------------------------------*/ - struct int_tree_map { - unsigned int uid; - tree to; - }; - - /* Macros for showing usage statistics. */ - #define SCALE(x) ((unsigned long) ((x) < 1024*10 \ - ? (x) \ - : ((x) < 1024*1024*10 \ - ? (x) / 1024 \ - : (x) / (1024*1024)))) - - #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M')) - - #define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y)) - /*--------------------------------------------------------------------------- OpenMP Region Tree ---------------------------------------------------------------------------*/ --- 36,41 ---- *************** enum move_pos *** 375,384 **** extern enum move_pos movement_possibility (gimple); char *get_lsm_tmp_name (tree, unsigned); - /* In tree-flow-inline.h */ - static inline bool unmodifiable_var_p (const_tree); - static inline bool ref_contains_array_ref (const_tree); - /* In tree-eh.c */ extern void make_eh_edges (gimple); extern bool make_eh_dispatch_edges (gimple); --- 294,299 ---- Index: tree-flow-inline.h =================================================================== *** tree-flow-inline.h (revision 203148) --- tree-flow-inline.h (working copy) *************** *** 1,197 **** - /* Inline functions for tree-flow.h - Copyright (C) 2001-2013 Free Software Foundation, Inc. - Contributed by Diego Novillo - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING3. If not see - . */ - - #ifndef _TREE_FLOW_INLINE_H - #define _TREE_FLOW_INLINE_H 1 - - /* Inline functions for manipulating various data structures defined in - tree-flow.h. See tree-flow.h for documentation. */ - - /* Return true when gimple SSA form was built. - gimple_in_ssa_p is queried by gimplifier in various early stages before SSA - infrastructure is initialized. Check for presence of the datastructures - at first place. */ - static inline bool - gimple_in_ssa_p (const struct function *fun) - { - return fun && fun->gimple_df && fun->gimple_df->in_ssa_p; - } - - /* Artificial variable used for the virtual operand FUD chain. */ - static inline tree - gimple_vop (const struct function *fun) - { - gcc_checking_assert (fun && fun->gimple_df); - return fun->gimple_df->vop; - } - - /* Get the number of the next statement uid to be allocated. */ - static inline unsigned int - gimple_stmt_max_uid (struct function *fn) - { - return fn->last_stmt_uid; - } - - /* Set the number of the next statement uid to be allocated. */ - static inline void - set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid) - { - fn->last_stmt_uid = maxid; - } - - /* Set the number of the next statement uid to be allocated. */ - static inline unsigned int - inc_gimple_stmt_max_uid (struct function *fn) - { - return fn->last_stmt_uid++; - } - - /* Return the line number for EXPR, or return -1 if we have no line - number information for it. */ - static inline int - get_lineno (const_gimple stmt) - { - location_t loc; - - if (!stmt) - return -1; - - loc = gimple_location (stmt); - if (loc == UNKNOWN_LOCATION) - return -1; - - return LOCATION_LINE (loc); - } - - - /* Return true if T (assumed to be a DECL) is a global variable. - A variable is considered global if its storage is not automatic. */ - - static inline bool - is_global_var (const_tree t) - { - return (TREE_STATIC (t) || DECL_EXTERNAL (t)); - } - - - /* Return true if VAR may be aliased. A variable is considered as - maybe aliased if it has its address taken by the local TU - or possibly by another TU and might be modified through a pointer. */ - - static inline bool - may_be_aliased (const_tree var) - { - return (TREE_CODE (var) != CONST_DECL - && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var)) - && TREE_READONLY (var) - && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var))) - && (TREE_PUBLIC (var) - || DECL_EXTERNAL (var) - || TREE_ADDRESSABLE (var))); - } - - - /* Returns the loop of the statement STMT. */ - - static inline struct loop * - loop_containing_stmt (gimple stmt) - { - basic_block bb = gimple_bb (stmt); - if (!bb) - return NULL; - - return bb->loop_father; - } - - - - /* Return true if VAR cannot be modified by the program. */ - - static inline bool - unmodifiable_var_p (const_tree var) - { - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - - return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var)); - } - - /* Return true if REF, a handled component reference, has an ARRAY_REF - somewhere in it. */ - - static inline bool - ref_contains_array_ref (const_tree ref) - { - gcc_checking_assert (handled_component_p (ref)); - - do { - if (TREE_CODE (ref) == ARRAY_REF) - return true; - ref = TREE_OPERAND (ref, 0); - } while (handled_component_p (ref)); - - return false; - } - - /* Return true if REF has an VIEW_CONVERT_EXPR somewhere in it. */ - - static inline bool - contains_view_convert_expr_p (const_tree ref) - { - while (handled_component_p (ref)) - { - if (TREE_CODE (ref) == VIEW_CONVERT_EXPR) - return true; - ref = TREE_OPERAND (ref, 0); - } - - return false; - } - - /* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2] - overlap. SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the - range is open-ended. Otherwise return false. */ - - static inline bool - ranges_overlap_p (unsigned HOST_WIDE_INT pos1, - unsigned HOST_WIDE_INT size1, - unsigned HOST_WIDE_INT pos2, - unsigned HOST_WIDE_INT size2) - { - if (pos1 >= pos2 - && (size2 == (unsigned HOST_WIDE_INT)-1 - || pos1 < (pos2 + size2))) - return true; - if (pos2 >= pos1 - && (size1 == (unsigned HOST_WIDE_INT)-1 - || pos2 < (pos1 + size1))) - return true; - - return false; - } - - /* Accessor to tree-ssa-operands.c caches. */ - static inline struct ssa_operands * - gimple_ssa_operands (const struct function *fun) - { - return &fun->gimple_df->ssa_operands; - } - - #endif /* _TREE_FLOW_INLINE_H */ --- 0 ---- Index: gimple-ssa.h =================================================================== *** gimple-ssa.h (revision 203148) --- gimple-ssa.h (working copy) *************** along with GCC; see the file COPYING3. *** 21,26 **** --- 21,108 ---- #ifndef GCC_GIMPLE_SSA_H #define GCC_GIMPLE_SSA_H + /* This structure is used to map a gimple statement to a label, + or list of labels to represent transaction restart. */ + + struct GTY(()) tm_restart_node { + gimple stmt; + tree label_or_list; + }; + + /* Gimple dataflow datastructure. All publicly available fields shall have + gimple_ accessor defined, all publicly modifiable fields should have + gimple_set accessor. */ + struct GTY(()) gimple_df { + /* A vector of all the noreturn calls passed to modify_stmt. + cleanup_control_flow uses it to detect cases where a mid-block + indirect call has been turned into a noreturn call. When this + happens, all the instructions after the call are no longer + reachable and must be deleted as dead. */ + vec *modified_noreturn_calls; + + /* Array of all SSA_NAMEs used in the function. */ + vec *ssa_names; + + /* Artificial variable used for the virtual operand FUD chain. */ + tree vop; + + /* The PTA solution for the ESCAPED artificial variable. */ + struct pt_solution escaped; + + /* A map of decls to artificial ssa-names that point to the partition + of the decl. */ + struct pointer_map_t * GTY((skip(""))) decls_to_pointers; + + /* Free list of SSA_NAMEs. */ + vec *free_ssanames; + + /* Hashtable holding definition for symbol. If this field is not NULL, it + means that the first reference to this variable in the function is a + USE or a VUSE. In those cases, the SSA renamer creates an SSA name + for this variable with an empty defining statement. */ + htab_t GTY((param_is (union tree_node))) default_defs; + + /* True if there are any symbols that need to be renamed. */ + unsigned int ssa_renaming_needed : 1; + + /* True if all virtual operands need to be renamed. */ + unsigned int rename_vops : 1; + + /* True if the code is in ssa form. */ + unsigned int in_ssa_p : 1; + + /* True if IPA points-to information was computed for this function. */ + unsigned int ipa_pta : 1; + + struct ssa_operands ssa_operands; + + /* Map gimple stmt to tree label (or list of labels) for transaction + restart and abort. */ + htab_t GTY ((param_is (struct tm_restart_node))) tm_restart; + }; + + + /* Return true when gimple SSA form was built. + gimple_in_ssa_p is queried by gimplifier in various early stages before SSA + infrastructure is initialized. Check for presence of the datastructures + at first place. */ + static inline bool + gimple_in_ssa_p (const struct function *fun) + { + return fun && fun->gimple_df && fun->gimple_df->in_ssa_p; + } + + /* Inline functions for manipulating various data structures defined in + tree-flow.h. See tree-flow.h for documentation. */ + + /* Artificial variable used for the virtual operand FUD chain. */ + static inline tree + gimple_vop (const struct function *fun) + { + gcc_checking_assert (fun && fun->gimple_df); + return fun->gimple_df->vop; + } + /* Return the set of VUSE operand for statement G. */ static inline use_operand_p Index: gimple.h =================================================================== *** gimple.h (revision 203148) --- gimple.h (working copy) *************** is_gimple_sizepos (tree expr) *** 1027,1032 **** --- 1027,1053 ---- || CONTAINS_PLACEHOLDER_P (expr)); } + /* Get the number of the next statement uid to be allocated. */ + static inline unsigned int + gimple_stmt_max_uid (struct function *fn) + { + return fn->last_stmt_uid; + } + + /* Set the number of the next statement uid to be allocated. */ + static inline void + set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid) + { + fn->last_stmt_uid = maxid; + } + + /* Set the number of the next statement uid to be allocated. */ + static inline unsigned int + inc_gimple_stmt_max_uid (struct function *fn) + { + return fn->last_stmt_uid++; + } + extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *, bool (*) (tree), fallback_t); extern void gimplify_type_sizes (tree, gimple_seq *); *************** extern tree gimple_boolify (tree); *** 1054,1059 **** --- 1075,1081 ---- extern gimple_predicate rhs_predicate_for (tree); extern tree canonicalize_cond_expr_cond (tree); extern void dump_decl_set (FILE *, bitmap); + extern bool gimple_can_coalesce_p (tree, tree); extern bool nonfreeing_call_p (gimple); /* In omp-low.c. */ *************** extern tree gimple_assign_rhs_to_tree (g *** 1076,1084 **** /* In builtins.c */ extern bool validate_gimple_arglist (const_gimple, ...); - /* In tree-ssa-coalesce.c */ - extern bool gimple_can_coalesce_p (tree, tree); - /* Return the first node in GIMPLE sequence S. */ static inline gimple_seq_node --- 1098,1103 ---- *************** gimple_debug_source_bind_set_value (gimp *** 3909,3914 **** --- 3928,3950 ---- gimple_set_op (dbg, 1, value); } + /* Return the line number for EXPR, or return -1 if we have no line + number information for it. */ + static inline int + get_lineno (const_gimple stmt) + { + location_t loc; + + if (!stmt) + return -1; + + loc = gimple_location (stmt); + if (loc == UNKNOWN_LOCATION) + return -1; + + return LOCATION_LINE (loc); + } + /* Return a pointer to the body for the OMP statement GS. */ static inline gimple_seq * *************** gimple_seq_set_location (gimple_seq seq, *** 5430,5433 **** --- 5466,5481 ---- gimple_set_location (gsi_stmt (i), loc); } + /* Macros for showing usage statistics. */ + #define SCALE(x) ((unsigned long) ((x) < 1024*10 \ + ? (x) \ + : ((x) < 1024*1024*10 \ + ? (x) / 1024 \ + : (x) / (1024*1024)))) + + #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M')) + + #define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y)) + + #endif /* GCC_GIMPLE_H */ Index: tree-hasher.h =================================================================== *** tree-hasher.h (revision 203148) --- tree-hasher.h (working copy) *************** along with GCC; see the file COPYING3. *** 22,28 **** #define GCC_TREE_HASHER_H 1 #include "hash-table.h" ! #include "tree-flow.h" /* Hashtable helpers. */ --- 22,32 ---- #define GCC_TREE_HASHER_H 1 #include "hash-table.h" ! ! struct int_tree_map { ! unsigned int uid; ! tree to; ! }; /* Hashtable helpers. */ Index: tree-sra.c =================================================================== *** tree-sra.c (revision 203148) --- tree-sra.c (working copy) *************** completely_scalarize_var (tree var) *** 1009,1014 **** --- 1009,1029 ---- completely_scalarize_record (var, var, 0, var); } + /* Return true if REF has an VIEW_CONVERT_EXPR somewhere in it. */ + + static inline bool + contains_view_convert_expr_p (const_tree ref) + { + while (handled_component_p (ref)) + { + if (TREE_CODE (ref) == VIEW_CONVERT_EXPR) + return true; + ref = TREE_OPERAND (ref, 0); + } + + return false; + } + /* Search the given tree for a declaration by skipping handled components and exclude it from the candidates. */ Index: tree-ssa-alias.h =================================================================== *** tree-ssa-alias.h (revision 203148) --- tree-ssa-alias.h (working copy) *************** extern void dump_pta_stats (FILE *); *** 141,145 **** --- 141,168 ---- extern GTY(()) struct pt_solution ipa_escaped_pt; + /* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2] + overlap. SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the + range is open-ended. Otherwise return false. */ + + static inline bool + ranges_overlap_p (unsigned HOST_WIDE_INT pos1, + unsigned HOST_WIDE_INT size1, + unsigned HOST_WIDE_INT pos2, + unsigned HOST_WIDE_INT size2) + { + if (pos1 >= pos2 + && (size2 == (unsigned HOST_WIDE_INT)-1 + || pos1 < (pos2 + size2))) + return true; + if (pos2 >= pos1 + && (size1 == (unsigned HOST_WIDE_INT)-1 + || pos2 < (pos1 + size1))) + return true; + + return false; + } + + #endif /* TREE_SSA_ALIAS_H */ Index: tree-ssa-operands.c =================================================================== *** tree-ssa-operands.c (revision 203148) --- tree-ssa-operands.c (working copy) *************** static void get_expr_operands (gimple, t *** 122,127 **** --- 122,134 ---- /* Number of functions with initialized ssa_operands. */ static int n_initialized = 0; + /* Accessor to tree-ssa-operands.c caches. */ + static inline struct ssa_operands * + gimple_ssa_operands (const struct function *fun) + { + return &fun->gimple_df->ssa_operands; + } + /* Return true if the SSA operands cache is active. */ Index: tree.h =================================================================== *** tree.h (revision 203148) --- tree.h (working copy) *************** builtin_decl_implicit_p (enum built_in_f *** 4958,4963 **** --- 4958,4988 ---- && builtin_info.implicit_p[uns_fncode]); } + /* Return true if T (assumed to be a DECL) is a global variable. + A variable is considered global if its storage is not automatic. */ + + static inline bool + is_global_var (const_tree t) + { + return (TREE_STATIC (t) || DECL_EXTERNAL (t)); + } + + /* Return true if VAR may be aliased. A variable is considered as + maybe aliased if it has its address taken by the local TU + or possibly by another TU and might be modified through a pointer. */ + + static inline bool + may_be_aliased (const_tree var) + { + return (TREE_CODE (var) != CONST_DECL + && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var)) + && TREE_READONLY (var) + && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var))) + && (TREE_PUBLIC (var) + || DECL_EXTERNAL (var) + || TREE_ADDRESSABLE (var))); + } + /* For anonymous aggregate types, we need some sort of name to hold on to. In practice, this should not appear, but it should not be harmful if it does. */ Index: Makefile.in =================================================================== *** Makefile.in (revision 203148) --- Makefile.in (working copy) *************** GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp *** 2241,2247 **** $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \ $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \ $(srcdir)/gimple.h $(srcdir)/gimple.c \ ! $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \ $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \ $(srcdir)/tree-cfg.c \ $(srcdir)/tree-dfa.c \ --- 2241,2247 ---- $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \ $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \ $(srcdir)/gimple.h $(srcdir)/gimple.c \ ! $(srcdir)/tree-mudflap.c $(srcdir)/gimple-ssa.h \ $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \ $(srcdir)/tree-cfg.c \ $(srcdir)/tree-dfa.c \