Mercurial > hg > CbC > CbC_gcc
comparison gcc/gimple.h @ 69:1b10fe6932e1
merge 69
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 21 Aug 2011 07:53:12 +0900 |
parents | 326d9e06c2e3 f6334be47118 |
children | b81903832de2 |
comparison
equal
deleted
inserted
replaced
66:b362627d71ba | 69:1b10fe6932e1 |
---|---|
1 /* Gimple IR definitions. | 1 /* Gimple IR definitions. |
2 | 2 |
3 Copyright 2007, 2008, 2009 Free Software Foundation, Inc. | 3 Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
4 Contributed by Aldy Hernandez <aldyh@redhat.com> | 4 Contributed by Aldy Hernandez <aldyh@redhat.com> |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
8 GCC is free software; you can redistribute it and/or modify it under | 8 GCC is free software; you can redistribute it and/or modify it under |
22 #ifndef GCC_GIMPLE_H | 22 #ifndef GCC_GIMPLE_H |
23 #define GCC_GIMPLE_H | 23 #define GCC_GIMPLE_H |
24 | 24 |
25 #include "pointer-set.h" | 25 #include "pointer-set.h" |
26 #include "vec.h" | 26 #include "vec.h" |
27 #include "vecprim.h" | |
28 #include "vecir.h" | |
27 #include "ggc.h" | 29 #include "ggc.h" |
28 #include "tm.h" | |
29 #include "hard-reg-set.h" | |
30 #include "basic-block.h" | 30 #include "basic-block.h" |
31 #include "tree-ssa-operands.h" | 31 #include "tree-ssa-operands.h" |
32 | 32 #include "tree-ssa-alias.h" |
33 DEF_VEC_P(gimple); | 33 |
34 DEF_VEC_ALLOC_P(gimple,heap); | 34 struct gimple_seq_node_d; |
35 DEF_VEC_ALLOC_P(gimple,gc); | 35 typedef struct gimple_seq_node_d *gimple_seq_node; |
36 | 36 typedef const struct gimple_seq_node_d *const_gimple_seq_node; |
37 typedef gimple *gimple_p; | |
38 DEF_VEC_P(gimple_p); | |
39 DEF_VEC_ALLOC_P(gimple_p,heap); | |
40 | |
41 DEF_VEC_P(gimple_seq); | |
42 DEF_VEC_ALLOC_P(gimple_seq,gc); | |
43 DEF_VEC_ALLOC_P(gimple_seq,heap); | |
44 | 37 |
45 /* For each block, the PHI nodes that need to be rewritten are stored into | 38 /* For each block, the PHI nodes that need to be rewritten are stored into |
46 these vectors. */ | 39 these vectors. */ |
47 typedef VEC(gimple, heap) *gimple_vec; | 40 typedef VEC(gimple, heap) *gimple_vec; |
48 DEF_VEC_P (gimple_vec); | 41 DEF_VEC_P (gimple_vec); |
58 extern const char *const gimple_code_name[]; | 51 extern const char *const gimple_code_name[]; |
59 extern const unsigned char gimple_rhs_class_table[]; | 52 extern const unsigned char gimple_rhs_class_table[]; |
60 | 53 |
61 /* Error out if a gimple tuple is addressed incorrectly. */ | 54 /* Error out if a gimple tuple is addressed incorrectly. */ |
62 #if defined ENABLE_GIMPLE_CHECKING | 55 #if defined ENABLE_GIMPLE_CHECKING |
56 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR) | |
63 extern void gimple_check_failed (const_gimple, const char *, int, \ | 57 extern void gimple_check_failed (const_gimple, const char *, int, \ |
64 const char *, enum gimple_code, \ | 58 const char *, enum gimple_code, \ |
65 enum tree_code) ATTRIBUTE_NORETURN; | 59 enum tree_code) ATTRIBUTE_NORETURN; |
66 | 60 |
67 #define GIMPLE_CHECK(GS, CODE) \ | 61 #define GIMPLE_CHECK(GS, CODE) \ |
70 if (gimple_code (__gs) != (CODE)) \ | 64 if (gimple_code (__gs) != (CODE)) \ |
71 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \ | 65 gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \ |
72 (CODE), ERROR_MARK); \ | 66 (CODE), ERROR_MARK); \ |
73 } while (0) | 67 } while (0) |
74 #else /* not ENABLE_GIMPLE_CHECKING */ | 68 #else /* not ENABLE_GIMPLE_CHECKING */ |
69 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR))) | |
75 #define GIMPLE_CHECK(GS, CODE) (void)0 | 70 #define GIMPLE_CHECK(GS, CODE) (void)0 |
76 #endif | 71 #endif |
77 | 72 |
78 /* Class of GIMPLE expressions suitable for the RHS of assignments. See | 73 /* Class of GIMPLE expressions suitable for the RHS of assignments. See |
79 get_gimple_rhs_class. */ | 74 get_gimple_rhs_class. */ |
80 enum gimple_rhs_class | 75 enum gimple_rhs_class |
81 { | 76 { |
82 GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */ | 77 GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */ |
78 GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */ | |
83 GIMPLE_BINARY_RHS, /* The expression is a binary operation. */ | 79 GIMPLE_BINARY_RHS, /* The expression is a binary operation. */ |
84 GIMPLE_UNARY_RHS, /* The expression is a unary operation. */ | 80 GIMPLE_UNARY_RHS, /* The expression is a unary operation. */ |
85 GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA | 81 GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA |
86 name, a _DECL, a _REF, etc. */ | 82 name, a _DECL, a _REF, etc. */ |
87 }; | 83 }; |
106 GF_CALL_TAILCALL = 1 << 3, | 102 GF_CALL_TAILCALL = 1 << 3, |
107 GF_CALL_VA_ARG_PACK = 1 << 4, | 103 GF_CALL_VA_ARG_PACK = 1 << 4, |
108 #ifndef noCbC | 104 #ifndef noCbC |
109 GF_CALL_CBC_GOTO = 1 << 5, | 105 GF_CALL_CBC_GOTO = 1 << 5, |
110 #endif | 106 #endif |
107 GF_CALL_NOTHROW = 1 << 5, | |
111 GF_OMP_PARALLEL_COMBINED = 1 << 0, | 108 GF_OMP_PARALLEL_COMBINED = 1 << 0, |
112 | 109 |
113 /* True on an GIMPLE_OMP_RETURN statement if the return does not require | 110 /* True on an GIMPLE_OMP_RETURN statement if the return does not require |
114 a thread synchronization via some sort of barrier. The exact barrier | 111 a thread synchronization via some sort of barrier. The exact barrier |
115 that would otherwise be emitted is dependent on the OMP statement with | 112 that would otherwise be emitted is dependent on the OMP statement with |
221 } | 218 } |
222 | 219 |
223 | 220 |
224 void gimple_seq_add_stmt (gimple_seq *, gimple); | 221 void gimple_seq_add_stmt (gimple_seq *, gimple); |
225 | 222 |
223 /* Link gimple statement GS to the end of the sequence *SEQ_P. If | |
224 *SEQ_P is NULL, a new sequence is allocated. This function is | |
225 similar to gimple_seq_add_stmt, but does not scan the operands. | |
226 During gimplification, we need to manipulate statement sequences | |
227 before the def/use vectors have been constructed. */ | |
228 void gimplify_seq_add_stmt (gimple_seq *, gimple); | |
229 | |
226 /* Allocate a new sequence and initialize its first element with STMT. */ | 230 /* Allocate a new sequence and initialize its first element with STMT. */ |
227 | 231 |
228 static inline gimple_seq | 232 static inline gimple_seq |
229 gimple_seq_alloc_with_stmt (gimple stmt) | 233 gimple_seq_alloc_with_stmt (gimple stmt) |
230 { | 234 { |
246 /* Sets the sequence of statements in BB to SEQ. */ | 250 /* Sets the sequence of statements in BB to SEQ. */ |
247 | 251 |
248 static inline void | 252 static inline void |
249 set_bb_seq (basic_block bb, gimple_seq seq) | 253 set_bb_seq (basic_block bb, gimple_seq seq) |
250 { | 254 { |
251 gcc_assert (!(bb->flags & BB_RTL)); | 255 gcc_checking_assert (!(bb->flags & BB_RTL)); |
252 bb->il.gimple->seq = seq; | 256 bb->il.gimple->seq = seq; |
253 } | 257 } |
254 | 258 |
255 /* Iterator object for GIMPLE statement sequences. */ | 259 /* Iterator object for GIMPLE statement sequences. */ |
256 | 260 |
391 structure cannot be embedded inside another one. */ | 395 structure cannot be embedded inside another one. */ |
392 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; | 396 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; |
393 }; | 397 }; |
394 | 398 |
395 | 399 |
400 /* Call statements that take both memory and register operands. */ | |
401 | |
402 struct GTY(()) gimple_statement_call | |
403 { | |
404 /* [ WORD 1-8 ] */ | |
405 struct gimple_statement_with_memory_ops_base membase; | |
406 | |
407 /* [ WORD 9-12 ] */ | |
408 struct pt_solution call_used; | |
409 struct pt_solution call_clobbered; | |
410 | |
411 /* [ WORD 13 ] | |
412 Operand vector. NOTE! This must always be the last field | |
413 of this structure. In particular, this means that this | |
414 structure cannot be embedded inside another one. */ | |
415 tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1]; | |
416 }; | |
417 | |
418 | |
396 /* OpenMP statements (#pragma omp). */ | 419 /* OpenMP statements (#pragma omp). */ |
397 | 420 |
398 struct GTY(()) gimple_statement_omp { | 421 struct GTY(()) gimple_statement_omp { |
399 /* [ WORD 1-4 ] */ | 422 /* [ WORD 1-4 ] */ |
400 struct gimple_statement_base gsbase; | 423 struct gimple_statement_base gsbase; |
735 | 758 |
736 | 759 |
737 /* Define the overall contents of a gimple tuple. It may be any of the | 760 /* Define the overall contents of a gimple tuple. It may be any of the |
738 structures declared above for various types of tuples. */ | 761 structures declared above for various types of tuples. */ |
739 | 762 |
740 union GTY ((desc ("gimple_statement_structure (&%h)"))) gimple_statement_d { | 763 union GTY ((desc ("gimple_statement_structure (&%h)"), variable_size)) gimple_statement_d { |
741 struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase; | 764 struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase; |
742 struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops; | 765 struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops; |
743 struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase; | 766 struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase; |
744 struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem; | 767 struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem; |
768 struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call; | |
745 struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp; | 769 struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp; |
746 struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind; | 770 struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind; |
747 struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch; | 771 struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch; |
748 struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter; | 772 struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter; |
749 struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt; | 773 struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt; |
779 gimple gimple_build_return (tree); | 803 gimple gimple_build_return (tree); |
780 | 804 |
781 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL); | 805 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL); |
782 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO) | 806 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO) |
783 | 807 |
784 void extract_ops_from_tree (tree, enum tree_code *, tree *, tree *); | 808 void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *, tree *); |
785 | 809 |
786 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree, | 810 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree, |
787 tree MEM_STAT_DECL); | 811 tree, tree MEM_STAT_DECL); |
788 #define gimple_build_assign_with_ops(c,o1,o2,o3) \ | 812 #define gimple_build_assign_with_ops(c,o1,o2,o3) \ |
789 gimple_build_assign_with_ops_stat (c, o1, o2, o3 MEM_STAT_INFO) | 813 gimple_build_assign_with_ops_stat (c, o1, o2, o3, NULL_TREE MEM_STAT_INFO) |
814 #define gimple_build_assign_with_ops3(c,o1,o2,o3,o4) \ | |
815 gimple_build_assign_with_ops_stat (c, o1, o2, o3, o4 MEM_STAT_INFO) | |
790 | 816 |
791 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL); | 817 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL); |
792 #define gimple_build_debug_bind(var,val,stmt) \ | 818 #define gimple_build_debug_bind(var,val,stmt) \ |
793 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO) | 819 gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO) |
794 | 820 |
837 gimple_seq gimple_seq_alloc (void); | 863 gimple_seq gimple_seq_alloc (void); |
838 void gimple_seq_free (gimple_seq); | 864 void gimple_seq_free (gimple_seq); |
839 void gimple_seq_add_seq (gimple_seq *, gimple_seq); | 865 void gimple_seq_add_seq (gimple_seq *, gimple_seq); |
840 gimple_seq gimple_seq_copy (gimple_seq); | 866 gimple_seq gimple_seq_copy (gimple_seq); |
841 int gimple_call_flags (const_gimple); | 867 int gimple_call_flags (const_gimple); |
868 int gimple_call_return_flags (const_gimple); | |
869 int gimple_call_arg_flags (const_gimple, unsigned); | |
870 void gimple_call_reset_alias_info (gimple); | |
842 bool gimple_assign_copy_p (gimple); | 871 bool gimple_assign_copy_p (gimple); |
843 bool gimple_assign_ssa_name_copy_p (gimple); | 872 bool gimple_assign_ssa_name_copy_p (gimple); |
844 bool gimple_assign_single_p (gimple); | |
845 bool gimple_assign_unary_nop_p (gimple); | 873 bool gimple_assign_unary_nop_p (gimple); |
846 void gimple_set_bb (gimple, struct basic_block_def *); | 874 void gimple_set_bb (gimple, struct basic_block_def *); |
847 tree gimple_fold (const_gimple); | |
848 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree); | 875 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree); |
849 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code, | 876 void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code, |
850 tree, tree); | 877 tree, tree, tree); |
851 tree gimple_get_lhs (const_gimple); | 878 tree gimple_get_lhs (const_gimple); |
852 void gimple_set_lhs (gimple, tree); | 879 void gimple_set_lhs (gimple, tree); |
853 void gimple_replace_lhs (gimple, tree); | 880 void gimple_replace_lhs (gimple, tree); |
854 gimple gimple_copy (gimple); | 881 gimple gimple_copy (gimple); |
855 bool is_gimple_operand (const_tree); | |
856 void gimple_set_modified (gimple, bool); | 882 void gimple_set_modified (gimple, bool); |
857 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *); | 883 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *); |
858 gimple gimple_build_cond_from_tree (tree, tree, tree); | 884 gimple gimple_build_cond_from_tree (tree, tree, tree); |
859 void gimple_cond_set_condition_from_tree (gimple, tree); | 885 void gimple_cond_set_condition_from_tree (gimple, tree); |
860 bool gimple_has_side_effects (const_gimple); | 886 bool gimple_has_side_effects (const_gimple); |
861 bool gimple_rhs_has_side_effects (const_gimple); | 887 bool gimple_rhs_has_side_effects (const_gimple); |
862 bool gimple_could_trap_p (gimple); | 888 bool gimple_could_trap_p (gimple); |
889 bool gimple_could_trap_p_1 (gimple, bool, bool); | |
863 bool gimple_assign_rhs_could_trap_p (gimple); | 890 bool gimple_assign_rhs_could_trap_p (gimple); |
864 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *); | 891 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *); |
865 bool empty_body_p (gimple_seq); | 892 bool empty_body_p (gimple_seq); |
866 unsigned get_gimple_rhs_num_ops (enum tree_code); | 893 unsigned get_gimple_rhs_num_ops (enum tree_code); |
867 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO) | 894 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO) |
868 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL); | 895 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL); |
869 const char *gimple_decl_printable_name (tree, int); | 896 const char *gimple_decl_printable_name (tree, int); |
870 tree gimple_fold_obj_type_ref (tree, tree); | 897 bool gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace); |
871 | 898 tree gimple_get_virt_mehtod_for_binfo (HOST_WIDE_INT, tree, tree *, bool); |
899 void gimple_adjust_this_by_delta (gimple_stmt_iterator *, tree); | |
872 /* Returns true iff T is a valid GIMPLE statement. */ | 900 /* Returns true iff T is a valid GIMPLE statement. */ |
873 extern bool is_gimple_stmt (tree); | 901 extern bool is_gimple_stmt (tree); |
874 | 902 |
875 /* Returns true iff TYPE is a valid type for a scalar register variable. */ | 903 /* Returns true iff TYPE is a valid type for a scalar register variable. */ |
876 extern bool is_gimple_reg_type (tree); | 904 extern bool is_gimple_reg_type (tree); |
902 extern bool is_gimple_ip_invariant (const_tree); | 930 extern bool is_gimple_ip_invariant (const_tree); |
903 /* Returns true iff T is a GIMPLE rvalue. */ | 931 /* Returns true iff T is a GIMPLE rvalue. */ |
904 extern bool is_gimple_val (tree); | 932 extern bool is_gimple_val (tree); |
905 /* Returns true iff T is a GIMPLE asm statement input. */ | 933 /* Returns true iff T is a GIMPLE asm statement input. */ |
906 extern bool is_gimple_asm_val (tree); | 934 extern bool is_gimple_asm_val (tree); |
935 /* Returns true iff T is a valid address operand of a MEM_REF. */ | |
936 bool is_gimple_mem_ref_addr (tree); | |
907 /* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a | 937 /* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a |
908 GIMPLE temporary, a renamed user variable, or something else, | 938 GIMPLE temporary, a renamed user variable, or something else, |
909 respectively. */ | 939 respectively. */ |
910 extern bool is_gimple_reg_rhs (tree); | 940 extern bool is_gimple_reg_rhs (tree); |
911 extern bool is_gimple_mem_rhs (tree); | 941 extern bool is_gimple_mem_rhs (tree); |
912 | 942 |
913 /* Returns true iff T is a valid if-statement condition. */ | 943 /* Returns true iff T is a valid if-statement condition. */ |
914 extern bool is_gimple_condexpr (tree); | 944 extern bool is_gimple_condexpr (tree); |
915 | 945 |
916 /* Returns true iff T is a type conversion. */ | |
917 extern bool is_gimple_cast (tree); | |
918 /* Returns true iff T is a variable that does not need to live in memory. */ | 946 /* Returns true iff T is a variable that does not need to live in memory. */ |
919 extern bool is_gimple_non_addressable (tree t); | 947 extern bool is_gimple_non_addressable (tree t); |
920 | 948 |
921 /* Returns true iff T is a valid call address expression. */ | 949 /* Returns true iff T is a valid call address expression. */ |
922 extern bool is_gimple_call_addr (tree); | 950 extern bool is_gimple_call_addr (tree); |
923 /* If T makes a function call, returns the CALL_EXPR operand. */ | 951 /* If T makes a function call, returns the CALL_EXPR operand. */ |
924 extern tree get_call_expr_in (tree t); | 952 extern tree get_call_expr_in (tree t); |
925 | 953 |
926 extern void recalculate_side_effects (tree); | 954 extern void recalculate_side_effects (tree); |
927 extern bool compare_field_offset (tree, tree); | 955 extern bool gimple_compare_field_offset (tree, tree); |
928 extern tree gimple_register_type (tree); | 956 extern tree gimple_register_type (tree); |
957 extern tree gimple_register_canonical_type (tree); | |
958 enum gtc_mode { GTC_MERGE = 0, GTC_DIAG = 1 }; | |
959 extern bool gimple_types_compatible_p (tree, tree, enum gtc_mode); | |
929 extern void print_gimple_types_stats (void); | 960 extern void print_gimple_types_stats (void); |
930 extern void free_gimple_type_tables (void); | 961 extern void free_gimple_type_tables (void); |
931 extern tree gimple_unsigned_type (tree); | 962 extern tree gimple_unsigned_type (tree); |
932 extern tree gimple_signed_type (tree); | 963 extern tree gimple_signed_type (tree); |
933 extern alias_set_type gimple_get_alias_set (tree); | 964 extern alias_set_type gimple_get_alias_set (tree); |
939 bool (*)(gimple, tree, void *)); | 970 bool (*)(gimple, tree, void *)); |
940 extern bool walk_stmt_load_store_ops (gimple, void *, | 971 extern bool walk_stmt_load_store_ops (gimple, void *, |
941 bool (*)(gimple, tree, void *), | 972 bool (*)(gimple, tree, void *), |
942 bool (*)(gimple, tree, void *)); | 973 bool (*)(gimple, tree, void *)); |
943 extern bool gimple_ior_addresses_taken (bitmap, gimple); | 974 extern bool gimple_ior_addresses_taken (bitmap, gimple); |
975 extern bool gimple_call_builtin_p (gimple, enum built_in_function); | |
944 | 976 |
945 /* In gimplify.c */ | 977 /* In gimplify.c */ |
946 extern tree create_tmp_var_raw (tree, const char *); | 978 extern tree create_tmp_var_raw (tree, const char *); |
947 extern tree create_tmp_var_name (const char *); | 979 extern tree create_tmp_var_name (const char *); |
948 extern tree create_tmp_var (tree, const char *); | 980 extern tree create_tmp_var (tree, const char *); |
981 extern tree create_tmp_reg (tree, const char *); | |
949 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *); | 982 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *); |
950 extern tree get_formal_tmp_var (tree, gimple_seq *); | 983 extern tree get_formal_tmp_var (tree, gimple_seq *); |
951 extern void declare_vars (tree, gimple, bool); | 984 extern void declare_vars (tree, gimple, bool); |
952 extern void annotate_all_with_location (gimple_seq, location_t); | 985 extern void annotate_all_with_location (gimple_seq, location_t); |
953 | 986 |
1015 extern void gimple_add_tmp_var (tree); | 1048 extern void gimple_add_tmp_var (tree); |
1016 extern gimple gimple_current_bind_expr (void); | 1049 extern gimple gimple_current_bind_expr (void); |
1017 extern VEC(gimple, heap) *gimple_bind_expr_stack (void); | 1050 extern VEC(gimple, heap) *gimple_bind_expr_stack (void); |
1018 extern tree voidify_wrapper_expr (tree, tree); | 1051 extern tree voidify_wrapper_expr (tree, tree); |
1019 extern tree build_and_jump (tree *); | 1052 extern tree build_and_jump (tree *); |
1020 extern tree alloc_stmt_list (void); | |
1021 extern void free_stmt_list (tree); | |
1022 extern tree force_labels_r (tree *, int *, void *); | 1053 extern tree force_labels_r (tree *, int *, void *); |
1023 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *, | 1054 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *, |
1024 gimple_seq *); | 1055 gimple_seq *); |
1025 struct gimplify_omp_ctx; | 1056 struct gimplify_omp_ctx; |
1026 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree); | 1057 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree); |
1062 /* Return the GSS code used by a GIMPLE code. */ | 1093 /* Return the GSS code used by a GIMPLE code. */ |
1063 | 1094 |
1064 static inline enum gimple_statement_structure_enum | 1095 static inline enum gimple_statement_structure_enum |
1065 gss_for_code (enum gimple_code code) | 1096 gss_for_code (enum gimple_code code) |
1066 { | 1097 { |
1067 gcc_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE); | 1098 gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE); |
1068 return gss_for_code_[code]; | 1099 return gss_for_code_[code]; |
1069 } | 1100 } |
1070 | 1101 |
1071 | 1102 |
1072 /* Return which GSS code is used by GS. */ | 1103 /* Return which GSS code is used by GS. */ |
1302 /* Set DEF to be the set of DEF operands for statement G. */ | 1333 /* Set DEF to be the set of DEF operands for statement G. */ |
1303 | 1334 |
1304 static inline void | 1335 static inline void |
1305 gimple_set_def_ops (gimple g, struct def_optype_d *def) | 1336 gimple_set_def_ops (gimple g, struct def_optype_d *def) |
1306 { | 1337 { |
1307 gcc_assert (gimple_has_ops (g)); | 1338 gcc_gimple_checking_assert (gimple_has_ops (g)); |
1308 g->gsops.opbase.def_ops = def; | 1339 g->gsops.opbase.def_ops = def; |
1309 } | 1340 } |
1310 | 1341 |
1311 | 1342 |
1312 /* Return the set of USE operands for statement G. */ | 1343 /* Return the set of USE operands for statement G. */ |
1323 /* Set USE to be the set of USE operands for statement G. */ | 1354 /* Set USE to be the set of USE operands for statement G. */ |
1324 | 1355 |
1325 static inline void | 1356 static inline void |
1326 gimple_set_use_ops (gimple g, struct use_optype_d *use) | 1357 gimple_set_use_ops (gimple g, struct use_optype_d *use) |
1327 { | 1358 { |
1328 gcc_assert (gimple_has_ops (g)); | 1359 gcc_gimple_checking_assert (gimple_has_ops (g)); |
1329 g->gsops.opbase.use_ops = use; | 1360 g->gsops.opbase.use_ops = use; |
1330 } | 1361 } |
1331 | 1362 |
1332 | 1363 |
1333 /* Return the set of VUSE operand for statement G. */ | 1364 /* Return the set of VUSE operand for statement G. */ |
1404 /* Set the single VUSE operand of the statement G. */ | 1435 /* Set the single VUSE operand of the statement G. */ |
1405 | 1436 |
1406 static inline void | 1437 static inline void |
1407 gimple_set_vuse (gimple g, tree vuse) | 1438 gimple_set_vuse (gimple g, tree vuse) |
1408 { | 1439 { |
1409 gcc_assert (gimple_has_mem_ops (g)); | 1440 gcc_gimple_checking_assert (gimple_has_mem_ops (g)); |
1410 g->gsmembase.vuse = vuse; | 1441 g->gsmembase.vuse = vuse; |
1411 } | 1442 } |
1412 | 1443 |
1413 /* Set the single VDEF operand of the statement G. */ | 1444 /* Set the single VDEF operand of the statement G. */ |
1414 | 1445 |
1415 static inline void | 1446 static inline void |
1416 gimple_set_vdef (gimple g, tree vdef) | 1447 gimple_set_vdef (gimple g, tree vdef) |
1417 { | 1448 { |
1418 gcc_assert (gimple_has_mem_ops (g)); | 1449 gcc_gimple_checking_assert (gimple_has_mem_ops (g)); |
1419 g->gsmembase.vdef = vdef; | 1450 g->gsmembase.vdef = vdef; |
1420 } | 1451 } |
1421 | 1452 |
1422 | 1453 |
1423 /* Return true if statement G has operands and the modified field has | 1454 /* Return true if statement G has operands and the modified field has |
1440 gimple_expr_code (const_gimple stmt) | 1471 gimple_expr_code (const_gimple stmt) |
1441 { | 1472 { |
1442 enum gimple_code code = gimple_code (stmt); | 1473 enum gimple_code code = gimple_code (stmt); |
1443 if (code == GIMPLE_ASSIGN || code == GIMPLE_COND) | 1474 if (code == GIMPLE_ASSIGN || code == GIMPLE_COND) |
1444 return (enum tree_code) stmt->gsbase.subcode; | 1475 return (enum tree_code) stmt->gsbase.subcode; |
1445 else if (code == GIMPLE_CALL) | |
1446 return CALL_EXPR; | |
1447 else | 1476 else |
1448 gcc_unreachable (); | 1477 { |
1478 gcc_gimple_checking_assert (code == GIMPLE_CALL); | |
1479 return CALL_EXPR; | |
1480 } | |
1449 } | 1481 } |
1450 | 1482 |
1451 | 1483 |
1452 /* Mark statement S as modified, and update it. */ | 1484 /* Mark statement S as modified, and update it. */ |
1453 | 1485 |
1504 /* Return the subcode for OMP statement S. */ | 1536 /* Return the subcode for OMP statement S. */ |
1505 | 1537 |
1506 static inline unsigned | 1538 static inline unsigned |
1507 gimple_omp_subcode (const_gimple s) | 1539 gimple_omp_subcode (const_gimple s) |
1508 { | 1540 { |
1509 gcc_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD | 1541 gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD |
1510 && gimple_code (s) <= GIMPLE_OMP_SINGLE); | 1542 && gimple_code (s) <= GIMPLE_OMP_SINGLE); |
1511 return s->gsbase.subcode; | 1543 return s->gsbase.subcode; |
1512 } | 1544 } |
1513 | 1545 |
1514 /* Set the subcode for OMP statement S to SUBCODE. */ | 1546 /* Set the subcode for OMP statement S to SUBCODE. */ |
1516 static inline void | 1548 static inline void |
1517 gimple_omp_set_subcode (gimple s, unsigned int subcode) | 1549 gimple_omp_set_subcode (gimple s, unsigned int subcode) |
1518 { | 1550 { |
1519 /* We only have 16 bits for the subcode. Assert that we are not | 1551 /* We only have 16 bits for the subcode. Assert that we are not |
1520 overflowing it. */ | 1552 overflowing it. */ |
1521 gcc_assert (subcode < (1 << 16)); | 1553 gcc_gimple_checking_assert (subcode < (1 << 16)); |
1522 s->gsbase.subcode = subcode; | 1554 s->gsbase.subcode = subcode; |
1523 } | 1555 } |
1524 | 1556 |
1525 /* Set the nowait flag on OMP_RETURN statement S. */ | 1557 /* Set the nowait flag on OMP_RETURN statement S. */ |
1526 | 1558 |
1616 | 1648 |
1617 /* All the tuples have their operand vector at the very bottom | 1649 /* All the tuples have their operand vector at the very bottom |
1618 of the structure. Note that those structures that do not | 1650 of the structure. Note that those structures that do not |
1619 have an operand vector have a zero offset. */ | 1651 have an operand vector have a zero offset. */ |
1620 off = gimple_ops_offset_[gimple_statement_structure (gs)]; | 1652 off = gimple_ops_offset_[gimple_statement_structure (gs)]; |
1621 gcc_assert (off != 0); | 1653 gcc_gimple_checking_assert (off != 0); |
1622 | 1654 |
1623 return (tree *) ((char *) gs + off); | 1655 return (tree *) ((char *) gs + off); |
1624 } | 1656 } |
1625 | 1657 |
1626 | 1658 |
1629 static inline tree | 1661 static inline tree |
1630 gimple_op (const_gimple gs, unsigned i) | 1662 gimple_op (const_gimple gs, unsigned i) |
1631 { | 1663 { |
1632 if (gimple_has_ops (gs)) | 1664 if (gimple_has_ops (gs)) |
1633 { | 1665 { |
1634 gcc_assert (i < gimple_num_ops (gs)); | 1666 gcc_gimple_checking_assert (i < gimple_num_ops (gs)); |
1635 return gimple_ops (CONST_CAST_GIMPLE (gs))[i]; | 1667 return gimple_ops (CONST_CAST_GIMPLE (gs))[i]; |
1636 } | 1668 } |
1637 else | 1669 else |
1638 return NULL_TREE; | 1670 return NULL_TREE; |
1639 } | 1671 } |
1643 static inline tree * | 1675 static inline tree * |
1644 gimple_op_ptr (const_gimple gs, unsigned i) | 1676 gimple_op_ptr (const_gimple gs, unsigned i) |
1645 { | 1677 { |
1646 if (gimple_has_ops (gs)) | 1678 if (gimple_has_ops (gs)) |
1647 { | 1679 { |
1648 gcc_assert (i < gimple_num_ops (gs)); | 1680 gcc_gimple_checking_assert (i < gimple_num_ops (gs)); |
1649 return gimple_ops (CONST_CAST_GIMPLE (gs)) + i; | 1681 return gimple_ops (CONST_CAST_GIMPLE (gs)) + i; |
1650 } | 1682 } |
1651 else | 1683 else |
1652 return NULL; | 1684 return NULL; |
1653 } | 1685 } |
1655 /* Set operand I of statement GS to OP. */ | 1687 /* Set operand I of statement GS to OP. */ |
1656 | 1688 |
1657 static inline void | 1689 static inline void |
1658 gimple_set_op (gimple gs, unsigned i, tree op) | 1690 gimple_set_op (gimple gs, unsigned i, tree op) |
1659 { | 1691 { |
1660 gcc_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs)); | 1692 gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs)); |
1661 | 1693 |
1662 /* Note. It may be tempting to assert that OP matches | 1694 /* Note. It may be tempting to assert that OP matches |
1663 is_gimple_operand, but that would be wrong. Different tuples | 1695 is_gimple_operand, but that would be wrong. Different tuples |
1664 accept slightly different sets of tree operands. Each caller | 1696 accept slightly different sets of tree operands. Each caller |
1665 should perform its own validation. */ | 1697 should perform its own validation. */ |
1707 | 1739 |
1708 static inline void | 1740 static inline void |
1709 gimple_assign_set_lhs (gimple gs, tree lhs) | 1741 gimple_assign_set_lhs (gimple gs, tree lhs) |
1710 { | 1742 { |
1711 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | 1743 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); |
1712 gcc_assert (is_gimple_operand (lhs)); | |
1713 gimple_set_op (gs, 0, lhs); | 1744 gimple_set_op (gs, 0, lhs); |
1714 | 1745 |
1715 if (lhs && TREE_CODE (lhs) == SSA_NAME) | 1746 if (lhs && TREE_CODE (lhs) == SSA_NAME) |
1716 SSA_NAME_DEF_STMT (lhs) = gs; | 1747 SSA_NAME_DEF_STMT (lhs) = gs; |
1717 } | 1748 } |
1741 | 1772 |
1742 static inline void | 1773 static inline void |
1743 gimple_assign_set_rhs1 (gimple gs, tree rhs) | 1774 gimple_assign_set_rhs1 (gimple gs, tree rhs) |
1744 { | 1775 { |
1745 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | 1776 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); |
1746 | |
1747 /* If there are 3 or more operands, the 2 operands on the RHS must be | |
1748 GIMPLE values. */ | |
1749 if (gimple_num_ops (gs) >= 3) | |
1750 gcc_assert (is_gimple_val (rhs)); | |
1751 else | |
1752 gcc_assert (is_gimple_operand (rhs)); | |
1753 | 1777 |
1754 gimple_set_op (gs, 1, rhs); | 1778 gimple_set_op (gs, 1, rhs); |
1755 } | 1779 } |
1756 | 1780 |
1757 | 1781 |
1786 static inline void | 1810 static inline void |
1787 gimple_assign_set_rhs2 (gimple gs, tree rhs) | 1811 gimple_assign_set_rhs2 (gimple gs, tree rhs) |
1788 { | 1812 { |
1789 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | 1813 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); |
1790 | 1814 |
1791 /* The 2 operands on the RHS must be GIMPLE values. */ | |
1792 gcc_assert (is_gimple_val (rhs)); | |
1793 | |
1794 gimple_set_op (gs, 2, rhs); | 1815 gimple_set_op (gs, 2, rhs); |
1816 } | |
1817 | |
1818 /* Return the third operand on the RHS of assignment statement GS. | |
1819 If GS does not have two operands, NULL is returned instead. */ | |
1820 | |
1821 static inline tree | |
1822 gimple_assign_rhs3 (const_gimple gs) | |
1823 { | |
1824 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | |
1825 | |
1826 if (gimple_num_ops (gs) >= 4) | |
1827 return gimple_op (gs, 3); | |
1828 else | |
1829 return NULL_TREE; | |
1830 } | |
1831 | |
1832 /* Return a pointer to the third operand on the RHS of assignment | |
1833 statement GS. */ | |
1834 | |
1835 static inline tree * | |
1836 gimple_assign_rhs3_ptr (const_gimple gs) | |
1837 { | |
1838 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | |
1839 return gimple_op_ptr (gs, 3); | |
1840 } | |
1841 | |
1842 | |
1843 /* Set RHS to be the third operand on the RHS of assignment statement GS. */ | |
1844 | |
1845 static inline void | |
1846 gimple_assign_set_rhs3 (gimple gs, tree rhs) | |
1847 { | |
1848 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | |
1849 | |
1850 gimple_set_op (gs, 3, rhs); | |
1851 } | |
1852 | |
1853 /* A wrapper around gimple_assign_set_rhs_with_ops_1, for callers which expect | |
1854 to see only a maximum of two operands. */ | |
1855 | |
1856 static inline void | |
1857 gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code, | |
1858 tree op1, tree op2) | |
1859 { | |
1860 gimple_assign_set_rhs_with_ops_1 (gsi, code, op1, op2, NULL); | |
1861 } | |
1862 | |
1863 /* A wrapper around extract_ops_from_tree_1, for callers which expect | |
1864 to see only a maximum of two operands. */ | |
1865 | |
1866 static inline void | |
1867 extract_ops_from_tree (tree expr, enum tree_code *code, tree *op0, | |
1868 tree *op1) | |
1869 { | |
1870 tree op2; | |
1871 extract_ops_from_tree_1 (expr, code, op0, op1, &op2); | |
1872 gcc_assert (op2 == NULL_TREE); | |
1795 } | 1873 } |
1796 | 1874 |
1797 /* Returns true if GS is a nontemporal move. */ | 1875 /* Returns true if GS is a nontemporal move. */ |
1798 | 1876 |
1799 static inline bool | 1877 static inline bool |
1821 gimple_assign_rhs_code (const_gimple gs) | 1899 gimple_assign_rhs_code (const_gimple gs) |
1822 { | 1900 { |
1823 enum tree_code code; | 1901 enum tree_code code; |
1824 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); | 1902 GIMPLE_CHECK (gs, GIMPLE_ASSIGN); |
1825 | 1903 |
1826 code = gimple_expr_code (gs); | 1904 code = (enum tree_code) gs->gsbase.subcode; |
1905 /* While we initially set subcode to the TREE_CODE of the rhs for | |
1906 GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay | |
1907 in sync when we rewrite stmts into SSA form or do SSA propagations. */ | |
1827 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS) | 1908 if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS) |
1828 code = TREE_CODE (gimple_assign_rhs1 (gs)); | 1909 code = TREE_CODE (gimple_assign_rhs1 (gs)); |
1829 | 1910 |
1830 return code; | 1911 return code; |
1831 } | 1912 } |
1848 | 1929 |
1849 static inline enum gimple_rhs_class | 1930 static inline enum gimple_rhs_class |
1850 gimple_assign_rhs_class (const_gimple gs) | 1931 gimple_assign_rhs_class (const_gimple gs) |
1851 { | 1932 { |
1852 return get_gimple_rhs_class (gimple_assign_rhs_code (gs)); | 1933 return get_gimple_rhs_class (gimple_assign_rhs_code (gs)); |
1934 } | |
1935 | |
1936 /* Return true if GS is an assignment with a singleton RHS, i.e., | |
1937 there is no operator associated with the assignment itself. | |
1938 Unlike gimple_assign_copy_p, this predicate returns true for | |
1939 any RHS operand, including those that perform an operation | |
1940 and do not have the semantics of a copy, such as COND_EXPR. */ | |
1941 | |
1942 static inline bool | |
1943 gimple_assign_single_p (gimple gs) | |
1944 { | |
1945 return (is_gimple_assign (gs) | |
1946 && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS); | |
1853 } | 1947 } |
1854 | 1948 |
1855 | 1949 |
1856 /* Return true if S is a type-cast assignment. */ | 1950 /* Return true if S is a type-cast assignment. */ |
1857 | 1951 |
1902 | 1996 |
1903 static inline void | 1997 static inline void |
1904 gimple_call_set_lhs (gimple gs, tree lhs) | 1998 gimple_call_set_lhs (gimple gs, tree lhs) |
1905 { | 1999 { |
1906 GIMPLE_CHECK (gs, GIMPLE_CALL); | 2000 GIMPLE_CHECK (gs, GIMPLE_CALL); |
1907 gcc_assert (!lhs || is_gimple_operand (lhs)); | |
1908 gimple_set_op (gs, 0, lhs); | 2001 gimple_set_op (gs, 0, lhs); |
1909 if (lhs && TREE_CODE (lhs) == SSA_NAME) | 2002 if (lhs && TREE_CODE (lhs) == SSA_NAME) |
1910 SSA_NAME_DEF_STMT (lhs) = gs; | 2003 SSA_NAME_DEF_STMT (lhs) = gs; |
1911 } | 2004 } |
1912 | 2005 |
1937 | 2030 |
1938 static inline void | 2031 static inline void |
1939 gimple_call_set_fn (gimple gs, tree fn) | 2032 gimple_call_set_fn (gimple gs, tree fn) |
1940 { | 2033 { |
1941 GIMPLE_CHECK (gs, GIMPLE_CALL); | 2034 GIMPLE_CHECK (gs, GIMPLE_CALL); |
1942 gcc_assert (is_gimple_operand (fn)); | |
1943 gimple_set_op (gs, 1, fn); | 2035 gimple_set_op (gs, 1, fn); |
1944 } | 2036 } |
1945 | 2037 |
1946 | 2038 |
1947 /* Set FNDECL to be the function called by call statement GS. */ | 2039 /* Set FNDECL to be the function called by call statement GS. */ |
1948 | 2040 |
1949 static inline void | 2041 static inline void |
1950 gimple_call_set_fndecl (gimple gs, tree decl) | 2042 gimple_call_set_fndecl (gimple gs, tree decl) |
1951 { | 2043 { |
1952 GIMPLE_CHECK (gs, GIMPLE_CALL); | 2044 GIMPLE_CHECK (gs, GIMPLE_CALL); |
1953 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); | |
1954 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl)); | 2045 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl)); |
1955 } | 2046 } |
1956 | 2047 |
1957 | 2048 |
1958 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it. | 2049 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it. |
1963 gimple_call_fndecl (const_gimple gs) | 2054 gimple_call_fndecl (const_gimple gs) |
1964 { | 2055 { |
1965 tree addr = gimple_call_fn (gs); | 2056 tree addr = gimple_call_fn (gs); |
1966 if (TREE_CODE (addr) == ADDR_EXPR) | 2057 if (TREE_CODE (addr) == ADDR_EXPR) |
1967 { | 2058 { |
1968 gcc_assert (TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL); | 2059 tree fndecl = TREE_OPERAND (addr, 0); |
2060 if (TREE_CODE (fndecl) == MEM_REF) | |
2061 { | |
2062 if (TREE_CODE (TREE_OPERAND (fndecl, 0)) == ADDR_EXPR | |
2063 && integer_zerop (TREE_OPERAND (fndecl, 1))) | |
2064 return TREE_OPERAND (TREE_OPERAND (fndecl, 0), 0); | |
2065 else | |
2066 return NULL_TREE; | |
2067 } | |
1969 return TREE_OPERAND (addr, 0); | 2068 return TREE_OPERAND (addr, 0); |
1970 } | 2069 } |
1971 return NULL_TREE; | 2070 return NULL_TREE; |
1972 } | 2071 } |
1973 | 2072 |
1979 { | 2078 { |
1980 tree fn = gimple_call_fn (gs); | 2079 tree fn = gimple_call_fn (gs); |
1981 tree type = TREE_TYPE (fn); | 2080 tree type = TREE_TYPE (fn); |
1982 | 2081 |
1983 /* See through the pointer. */ | 2082 /* See through the pointer. */ |
1984 gcc_assert (POINTER_TYPE_P (type)); | |
1985 type = TREE_TYPE (type); | 2083 type = TREE_TYPE (type); |
1986 | |
1987 gcc_assert (TREE_CODE (type) == FUNCTION_TYPE | |
1988 || TREE_CODE (type) == METHOD_TYPE); | |
1989 | 2084 |
1990 /* The type returned by a FUNCTION_DECL is the type of its | 2085 /* The type returned by a FUNCTION_DECL is the type of its |
1991 function type. */ | 2086 function type. */ |
1992 return TREE_TYPE (type); | 2087 return TREE_TYPE (type); |
1993 } | 2088 } |
2016 | 2111 |
2017 static inline void | 2112 static inline void |
2018 gimple_call_set_chain (gimple gs, tree chain) | 2113 gimple_call_set_chain (gimple gs, tree chain) |
2019 { | 2114 { |
2020 GIMPLE_CHECK (gs, GIMPLE_CALL); | 2115 GIMPLE_CHECK (gs, GIMPLE_CALL); |
2021 gcc_assert (chain == NULL | 2116 |
2022 || TREE_CODE (chain) == ADDR_EXPR | |
2023 || SSA_VAR_P (chain)); | |
2024 gimple_set_op (gs, 2, chain); | 2117 gimple_set_op (gs, 2, chain); |
2025 } | 2118 } |
2026 | 2119 |
2027 | 2120 |
2028 /* Return the number of arguments used by call statement GS. */ | 2121 /* Return the number of arguments used by call statement GS. */ |
2031 gimple_call_num_args (const_gimple gs) | 2124 gimple_call_num_args (const_gimple gs) |
2032 { | 2125 { |
2033 unsigned num_ops; | 2126 unsigned num_ops; |
2034 GIMPLE_CHECK (gs, GIMPLE_CALL); | 2127 GIMPLE_CHECK (gs, GIMPLE_CALL); |
2035 num_ops = gimple_num_ops (gs); | 2128 num_ops = gimple_num_ops (gs); |
2036 gcc_assert (num_ops >= 3); | |
2037 return num_ops - 3; | 2129 return num_ops - 3; |
2038 } | 2130 } |
2039 | 2131 |
2040 | 2132 |
2041 /* Return the argument at position INDEX for call statement GS. */ | 2133 /* Return the argument at position INDEX for call statement GS. */ |
2063 | 2155 |
2064 static inline void | 2156 static inline void |
2065 gimple_call_set_arg (gimple gs, unsigned index, tree arg) | 2157 gimple_call_set_arg (gimple gs, unsigned index, tree arg) |
2066 { | 2158 { |
2067 GIMPLE_CHECK (gs, GIMPLE_CALL); | 2159 GIMPLE_CHECK (gs, GIMPLE_CALL); |
2068 gcc_assert (is_gimple_operand (arg)); | |
2069 gimple_set_op (gs, index + 3, arg); | 2160 gimple_set_op (gs, index + 3, arg); |
2070 } | 2161 } |
2071 | 2162 |
2072 | 2163 |
2073 /* If TAIL_P is true, mark call statement S as being a tail call | 2164 /* If TAIL_P is true, mark call statement S as being a tail call |
2225 GIMPLE_CHECK (s, GIMPLE_CALL); | 2316 GIMPLE_CHECK (s, GIMPLE_CALL); |
2226 return (gimple_call_flags (s) & ECF_NORETURN) != 0; | 2317 return (gimple_call_flags (s) & ECF_NORETURN) != 0; |
2227 } | 2318 } |
2228 | 2319 |
2229 | 2320 |
2321 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw | |
2322 even if the called function can throw in other cases. */ | |
2323 | |
2324 static inline void | |
2325 gimple_call_set_nothrow (gimple s, bool nothrow_p) | |
2326 { | |
2327 GIMPLE_CHECK (s, GIMPLE_CALL); | |
2328 if (nothrow_p) | |
2329 s->gsbase.subcode |= GF_CALL_NOTHROW; | |
2330 else | |
2331 s->gsbase.subcode &= ~GF_CALL_NOTHROW; | |
2332 } | |
2333 | |
2230 /* Return true if S is a nothrow call. */ | 2334 /* Return true if S is a nothrow call. */ |
2231 | 2335 |
2232 static inline bool | 2336 static inline bool |
2233 gimple_call_nothrow_p (gimple s) | 2337 gimple_call_nothrow_p (gimple s) |
2234 { | 2338 { |
2246 GIMPLE_CHECK (orig_call, GIMPLE_CALL); | 2350 GIMPLE_CHECK (orig_call, GIMPLE_CALL); |
2247 dest_call->gsbase.subcode = orig_call->gsbase.subcode; | 2351 dest_call->gsbase.subcode = orig_call->gsbase.subcode; |
2248 } | 2352 } |
2249 | 2353 |
2250 | 2354 |
2355 /* Return a pointer to the points-to solution for the set of call-used | |
2356 variables of the call CALL. */ | |
2357 | |
2358 static inline struct pt_solution * | |
2359 gimple_call_use_set (gimple call) | |
2360 { | |
2361 GIMPLE_CHECK (call, GIMPLE_CALL); | |
2362 return &call->gimple_call.call_used; | |
2363 } | |
2364 | |
2365 | |
2366 /* Return a pointer to the points-to solution for the set of call-used | |
2367 variables of the call CALL. */ | |
2368 | |
2369 static inline struct pt_solution * | |
2370 gimple_call_clobber_set (gimple call) | |
2371 { | |
2372 GIMPLE_CHECK (call, GIMPLE_CALL); | |
2373 return &call->gimple_call.call_clobbered; | |
2374 } | |
2375 | |
2376 | |
2251 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a | 2377 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a |
2252 non-NULL lhs. */ | 2378 non-NULL lhs. */ |
2253 | 2379 |
2254 static inline bool | 2380 static inline bool |
2255 gimple_has_lhs (gimple stmt) | 2381 gimple_has_lhs (gimple stmt) |
2274 | 2400 |
2275 static inline void | 2401 static inline void |
2276 gimple_cond_set_code (gimple gs, enum tree_code code) | 2402 gimple_cond_set_code (gimple gs, enum tree_code code) |
2277 { | 2403 { |
2278 GIMPLE_CHECK (gs, GIMPLE_COND); | 2404 GIMPLE_CHECK (gs, GIMPLE_COND); |
2279 gcc_assert (TREE_CODE_CLASS (code) == tcc_comparison); | |
2280 gs->gsbase.subcode = code; | 2405 gs->gsbase.subcode = code; |
2281 } | 2406 } |
2282 | 2407 |
2283 | 2408 |
2284 /* Return the LHS of the predicate computed by conditional statement GS. */ | 2409 /* Return the LHS of the predicate computed by conditional statement GS. */ |
2305 | 2430 |
2306 static inline void | 2431 static inline void |
2307 gimple_cond_set_lhs (gimple gs, tree lhs) | 2432 gimple_cond_set_lhs (gimple gs, tree lhs) |
2308 { | 2433 { |
2309 GIMPLE_CHECK (gs, GIMPLE_COND); | 2434 GIMPLE_CHECK (gs, GIMPLE_COND); |
2310 gcc_assert (is_gimple_operand (lhs)); | |
2311 gimple_set_op (gs, 0, lhs); | 2435 gimple_set_op (gs, 0, lhs); |
2312 } | 2436 } |
2313 | 2437 |
2314 | 2438 |
2315 /* Return the RHS operand of the predicate computed by conditional GS. */ | 2439 /* Return the RHS operand of the predicate computed by conditional GS. */ |
2337 | 2461 |
2338 static inline void | 2462 static inline void |
2339 gimple_cond_set_rhs (gimple gs, tree rhs) | 2463 gimple_cond_set_rhs (gimple gs, tree rhs) |
2340 { | 2464 { |
2341 GIMPLE_CHECK (gs, GIMPLE_COND); | 2465 GIMPLE_CHECK (gs, GIMPLE_COND); |
2342 gcc_assert (is_gimple_operand (rhs)); | |
2343 gimple_set_op (gs, 1, rhs); | 2466 gimple_set_op (gs, 1, rhs); |
2344 } | 2467 } |
2345 | 2468 |
2346 | 2469 |
2347 /* Return the label used by conditional statement GS when its | 2470 /* Return the label used by conditional statement GS when its |
2360 | 2483 |
2361 static inline void | 2484 static inline void |
2362 gimple_cond_set_true_label (gimple gs, tree label) | 2485 gimple_cond_set_true_label (gimple gs, tree label) |
2363 { | 2486 { |
2364 GIMPLE_CHECK (gs, GIMPLE_COND); | 2487 GIMPLE_CHECK (gs, GIMPLE_COND); |
2365 gcc_assert (!label || TREE_CODE (label) == LABEL_DECL); | |
2366 gimple_set_op (gs, 2, label); | 2488 gimple_set_op (gs, 2, label); |
2367 } | 2489 } |
2368 | 2490 |
2369 | 2491 |
2370 /* Set LABEL to be the label used by conditional statement GS when its | 2492 /* Set LABEL to be the label used by conditional statement GS when its |
2372 | 2494 |
2373 static inline void | 2495 static inline void |
2374 gimple_cond_set_false_label (gimple gs, tree label) | 2496 gimple_cond_set_false_label (gimple gs, tree label) |
2375 { | 2497 { |
2376 GIMPLE_CHECK (gs, GIMPLE_COND); | 2498 GIMPLE_CHECK (gs, GIMPLE_COND); |
2377 gcc_assert (!label || TREE_CODE (label) == LABEL_DECL); | |
2378 gimple_set_op (gs, 3, label); | 2499 gimple_set_op (gs, 3, label); |
2379 } | 2500 } |
2380 | 2501 |
2381 | 2502 |
2382 /* Return the label used by conditional statement GS when its | 2503 /* Return the label used by conditional statement GS when its |
2503 | 2624 |
2504 static inline void | 2625 static inline void |
2505 gimple_label_set_label (gimple gs, tree label) | 2626 gimple_label_set_label (gimple gs, tree label) |
2506 { | 2627 { |
2507 GIMPLE_CHECK (gs, GIMPLE_LABEL); | 2628 GIMPLE_CHECK (gs, GIMPLE_LABEL); |
2508 gcc_assert (TREE_CODE (label) == LABEL_DECL); | |
2509 gimple_set_op (gs, 0, label); | 2629 gimple_set_op (gs, 0, label); |
2510 } | 2630 } |
2511 | 2631 |
2512 | 2632 |
2513 /* Return the destination of the unconditional jump GS. */ | 2633 /* Return the destination of the unconditional jump GS. */ |
2524 | 2644 |
2525 static inline void | 2645 static inline void |
2526 gimple_goto_set_dest (gimple gs, tree dest) | 2646 gimple_goto_set_dest (gimple gs, tree dest) |
2527 { | 2647 { |
2528 GIMPLE_CHECK (gs, GIMPLE_GOTO); | 2648 GIMPLE_CHECK (gs, GIMPLE_GOTO); |
2529 gcc_assert (is_gimple_operand (dest)); | |
2530 gimple_set_op (gs, 0, dest); | 2649 gimple_set_op (gs, 0, dest); |
2531 } | 2650 } |
2532 | 2651 |
2533 | 2652 |
2534 /* Return the variables declared in the GIMPLE_BIND statement GS. */ | 2653 /* Return the variables declared in the GIMPLE_BIND statement GS. */ |
2620 | 2739 |
2621 static inline void | 2740 static inline void |
2622 gimple_bind_set_block (gimple gs, tree block) | 2741 gimple_bind_set_block (gimple gs, tree block) |
2623 { | 2742 { |
2624 GIMPLE_CHECK (gs, GIMPLE_BIND); | 2743 GIMPLE_CHECK (gs, GIMPLE_BIND); |
2625 gcc_assert (block == NULL_TREE || TREE_CODE (block) == BLOCK); | 2744 gcc_gimple_checking_assert (block == NULL_TREE |
2745 || TREE_CODE (block) == BLOCK); | |
2626 gs->gimple_bind.block = block; | 2746 gs->gimple_bind.block = block; |
2627 } | 2747 } |
2628 | 2748 |
2629 | 2749 |
2630 /* Return the number of input operands for GIMPLE_ASM GS. */ | 2750 /* Return the number of input operands for GIMPLE_ASM GS. */ |
2669 | 2789 |
2670 static inline tree | 2790 static inline tree |
2671 gimple_asm_input_op (const_gimple gs, unsigned index) | 2791 gimple_asm_input_op (const_gimple gs, unsigned index) |
2672 { | 2792 { |
2673 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2793 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2674 gcc_assert (index <= gs->gimple_asm.ni); | 2794 gcc_gimple_checking_assert (index <= gs->gimple_asm.ni); |
2675 return gimple_op (gs, index); | 2795 return gimple_op (gs, index); |
2676 } | 2796 } |
2677 | 2797 |
2678 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */ | 2798 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */ |
2679 | 2799 |
2680 static inline tree * | 2800 static inline tree * |
2681 gimple_asm_input_op_ptr (const_gimple gs, unsigned index) | 2801 gimple_asm_input_op_ptr (const_gimple gs, unsigned index) |
2682 { | 2802 { |
2683 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2803 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2684 gcc_assert (index <= gs->gimple_asm.ni); | 2804 gcc_gimple_checking_assert (index <= gs->gimple_asm.ni); |
2685 return gimple_op_ptr (gs, index); | 2805 return gimple_op_ptr (gs, index); |
2686 } | 2806 } |
2687 | 2807 |
2688 | 2808 |
2689 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */ | 2809 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS. */ |
2690 | 2810 |
2691 static inline void | 2811 static inline void |
2692 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op) | 2812 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op) |
2693 { | 2813 { |
2694 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2814 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2695 gcc_assert (index <= gs->gimple_asm.ni); | 2815 gcc_gimple_checking_assert (index <= gs->gimple_asm.ni |
2696 gcc_assert (TREE_CODE (in_op) == TREE_LIST); | 2816 && TREE_CODE (in_op) == TREE_LIST); |
2697 gimple_set_op (gs, index, in_op); | 2817 gimple_set_op (gs, index, in_op); |
2698 } | 2818 } |
2699 | 2819 |
2700 | 2820 |
2701 /* Return output operand INDEX of GIMPLE_ASM GS. */ | 2821 /* Return output operand INDEX of GIMPLE_ASM GS. */ |
2702 | 2822 |
2703 static inline tree | 2823 static inline tree |
2704 gimple_asm_output_op (const_gimple gs, unsigned index) | 2824 gimple_asm_output_op (const_gimple gs, unsigned index) |
2705 { | 2825 { |
2706 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2826 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2707 gcc_assert (index <= gs->gimple_asm.no); | 2827 gcc_gimple_checking_assert (index <= gs->gimple_asm.no); |
2708 return gimple_op (gs, index + gs->gimple_asm.ni); | 2828 return gimple_op (gs, index + gs->gimple_asm.ni); |
2709 } | 2829 } |
2710 | 2830 |
2711 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */ | 2831 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS. */ |
2712 | 2832 |
2713 static inline tree * | 2833 static inline tree * |
2714 gimple_asm_output_op_ptr (const_gimple gs, unsigned index) | 2834 gimple_asm_output_op_ptr (const_gimple gs, unsigned index) |
2715 { | 2835 { |
2716 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2836 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2717 gcc_assert (index <= gs->gimple_asm.no); | 2837 gcc_gimple_checking_assert (index <= gs->gimple_asm.no); |
2718 return gimple_op_ptr (gs, index + gs->gimple_asm.ni); | 2838 return gimple_op_ptr (gs, index + gs->gimple_asm.ni); |
2719 } | 2839 } |
2720 | 2840 |
2721 | 2841 |
2722 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */ | 2842 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS. */ |
2723 | 2843 |
2724 static inline void | 2844 static inline void |
2725 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op) | 2845 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op) |
2726 { | 2846 { |
2727 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2847 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2728 gcc_assert (index <= gs->gimple_asm.no); | 2848 gcc_gimple_checking_assert (index <= gs->gimple_asm.no |
2729 gcc_assert (TREE_CODE (out_op) == TREE_LIST); | 2849 && TREE_CODE (out_op) == TREE_LIST); |
2730 gimple_set_op (gs, index + gs->gimple_asm.ni, out_op); | 2850 gimple_set_op (gs, index + gs->gimple_asm.ni, out_op); |
2731 } | 2851 } |
2732 | 2852 |
2733 | 2853 |
2734 /* Return clobber operand INDEX of GIMPLE_ASM GS. */ | 2854 /* Return clobber operand INDEX of GIMPLE_ASM GS. */ |
2735 | 2855 |
2736 static inline tree | 2856 static inline tree |
2737 gimple_asm_clobber_op (const_gimple gs, unsigned index) | 2857 gimple_asm_clobber_op (const_gimple gs, unsigned index) |
2738 { | 2858 { |
2739 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2859 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2740 gcc_assert (index <= gs->gimple_asm.nc); | 2860 gcc_gimple_checking_assert (index <= gs->gimple_asm.nc); |
2741 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no); | 2861 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no); |
2742 } | 2862 } |
2743 | 2863 |
2744 | 2864 |
2745 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */ | 2865 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS. */ |
2746 | 2866 |
2747 static inline void | 2867 static inline void |
2748 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op) | 2868 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op) |
2749 { | 2869 { |
2750 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2870 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2751 gcc_assert (index <= gs->gimple_asm.nc); | 2871 gcc_gimple_checking_assert (index <= gs->gimple_asm.nc |
2752 gcc_assert (TREE_CODE (clobber_op) == TREE_LIST); | 2872 && TREE_CODE (clobber_op) == TREE_LIST); |
2753 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op); | 2873 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op); |
2754 } | 2874 } |
2755 | 2875 |
2756 /* Return label operand INDEX of GIMPLE_ASM GS. */ | 2876 /* Return label operand INDEX of GIMPLE_ASM GS. */ |
2757 | 2877 |
2758 static inline tree | 2878 static inline tree |
2759 gimple_asm_label_op (const_gimple gs, unsigned index) | 2879 gimple_asm_label_op (const_gimple gs, unsigned index) |
2760 { | 2880 { |
2761 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2881 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2762 gcc_assert (index <= gs->gimple_asm.nl); | 2882 gcc_gimple_checking_assert (index <= gs->gimple_asm.nl); |
2763 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc); | 2883 return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc); |
2764 } | 2884 } |
2765 | 2885 |
2766 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */ | 2886 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */ |
2767 | 2887 |
2768 static inline void | 2888 static inline void |
2769 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op) | 2889 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op) |
2770 { | 2890 { |
2771 GIMPLE_CHECK (gs, GIMPLE_ASM); | 2891 GIMPLE_CHECK (gs, GIMPLE_ASM); |
2772 gcc_assert (index <= gs->gimple_asm.nl); | 2892 gcc_gimple_checking_assert (index <= gs->gimple_asm.nl |
2773 gcc_assert (TREE_CODE (label_op) == TREE_LIST); | 2893 && TREE_CODE (label_op) == TREE_LIST); |
2774 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op); | 2894 gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op); |
2775 } | 2895 } |
2776 | 2896 |
2777 /* Return the string representing the assembly instruction in | 2897 /* Return the string representing the assembly instruction in |
2778 GIMPLE_ASM GS. */ | 2898 GIMPLE_ASM GS. */ |
2981 | 3101 |
2982 static inline void | 3102 static inline void |
2983 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind) | 3103 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind) |
2984 { | 3104 { |
2985 GIMPLE_CHECK (gs, GIMPLE_TRY); | 3105 GIMPLE_CHECK (gs, GIMPLE_TRY); |
2986 gcc_assert (kind == GIMPLE_TRY_CATCH || kind == GIMPLE_TRY_FINALLY); | 3106 gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH |
3107 || kind == GIMPLE_TRY_FINALLY); | |
2987 if (gimple_try_kind (gs) != kind) | 3108 if (gimple_try_kind (gs) != kind) |
2988 gs->gsbase.subcode = (unsigned int) kind; | 3109 gs->gsbase.subcode = (unsigned int) kind; |
2989 } | 3110 } |
2990 | 3111 |
2991 | 3112 |
2992 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */ | 3113 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */ |
2993 | 3114 |
2994 static inline bool | 3115 static inline bool |
2995 gimple_try_catch_is_cleanup (const_gimple gs) | 3116 gimple_try_catch_is_cleanup (const_gimple gs) |
2996 { | 3117 { |
2997 gcc_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH); | 3118 gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH); |
2998 return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0; | 3119 return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0; |
2999 } | 3120 } |
3000 | 3121 |
3001 | 3122 |
3002 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */ | 3123 /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */ |
3023 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */ | 3144 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */ |
3024 | 3145 |
3025 static inline void | 3146 static inline void |
3026 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup) | 3147 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup) |
3027 { | 3148 { |
3028 gcc_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH); | 3149 gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH); |
3029 if (catch_is_cleanup) | 3150 if (catch_is_cleanup) |
3030 g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP; | 3151 g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP; |
3031 else | 3152 else |
3032 g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP; | 3153 g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP; |
3033 } | 3154 } |
3150 | 3271 |
3151 static inline struct phi_arg_d * | 3272 static inline struct phi_arg_d * |
3152 gimple_phi_arg (gimple gs, unsigned index) | 3273 gimple_phi_arg (gimple gs, unsigned index) |
3153 { | 3274 { |
3154 GIMPLE_CHECK (gs, GIMPLE_PHI); | 3275 GIMPLE_CHECK (gs, GIMPLE_PHI); |
3155 gcc_assert (index <= gs->gimple_phi.capacity); | 3276 gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity); |
3156 return &(gs->gimple_phi.args[index]); | 3277 return &(gs->gimple_phi.args[index]); |
3157 } | 3278 } |
3158 | 3279 |
3159 /* Set PHIARG to be the argument corresponding to incoming edge INDEX | 3280 /* Set PHIARG to be the argument corresponding to incoming edge INDEX |
3160 for GIMPLE_PHI GS. */ | 3281 for GIMPLE_PHI GS. */ |
3161 | 3282 |
3162 static inline void | 3283 static inline void |
3163 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg) | 3284 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg) |
3164 { | 3285 { |
3165 GIMPLE_CHECK (gs, GIMPLE_PHI); | 3286 GIMPLE_CHECK (gs, GIMPLE_PHI); |
3166 gcc_assert (index <= gs->gimple_phi.nargs); | 3287 gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs); |
3167 memcpy (gs->gimple_phi.args + index, phiarg, sizeof (struct phi_arg_d)); | 3288 gs->gimple_phi.args[index] = *phiarg; |
3168 } | 3289 } |
3169 | 3290 |
3170 /* Return the region number for GIMPLE_RESX GS. */ | 3291 /* Return the region number for GIMPLE_RESX GS. */ |
3171 | 3292 |
3172 static inline int | 3293 static inline int |
3209 gimple_switch_num_labels (const_gimple gs) | 3330 gimple_switch_num_labels (const_gimple gs) |
3210 { | 3331 { |
3211 unsigned num_ops; | 3332 unsigned num_ops; |
3212 GIMPLE_CHECK (gs, GIMPLE_SWITCH); | 3333 GIMPLE_CHECK (gs, GIMPLE_SWITCH); |
3213 num_ops = gimple_num_ops (gs); | 3334 num_ops = gimple_num_ops (gs); |
3214 gcc_assert (num_ops > 1); | 3335 gcc_gimple_checking_assert (num_ops > 1); |
3215 return num_ops - 1; | 3336 return num_ops - 1; |
3216 } | 3337 } |
3217 | 3338 |
3218 | 3339 |
3219 /* Set NLABELS to be the number of labels for the switch statement GS. */ | 3340 /* Set NLABELS to be the number of labels for the switch statement GS. */ |
3250 | 3371 |
3251 static inline void | 3372 static inline void |
3252 gimple_switch_set_index (gimple gs, tree index) | 3373 gimple_switch_set_index (gimple gs, tree index) |
3253 { | 3374 { |
3254 GIMPLE_CHECK (gs, GIMPLE_SWITCH); | 3375 GIMPLE_CHECK (gs, GIMPLE_SWITCH); |
3255 gcc_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index)); | 3376 gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index)); |
3256 gimple_set_op (gs, 0, index); | 3377 gimple_set_op (gs, 0, index); |
3257 } | 3378 } |
3258 | 3379 |
3259 | 3380 |
3260 /* Return the label numbered INDEX. The default label is 0, followed by any | 3381 /* Return the label numbered INDEX. The default label is 0, followed by any |
3262 | 3383 |
3263 static inline tree | 3384 static inline tree |
3264 gimple_switch_label (const_gimple gs, unsigned index) | 3385 gimple_switch_label (const_gimple gs, unsigned index) |
3265 { | 3386 { |
3266 GIMPLE_CHECK (gs, GIMPLE_SWITCH); | 3387 GIMPLE_CHECK (gs, GIMPLE_SWITCH); |
3267 gcc_assert (gimple_num_ops (gs) > index + 1); | 3388 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1); |
3268 return gimple_op (gs, index + 1); | 3389 return gimple_op (gs, index + 1); |
3269 } | 3390 } |
3270 | 3391 |
3271 /* Set the label number INDEX to LABEL. 0 is always the default label. */ | 3392 /* Set the label number INDEX to LABEL. 0 is always the default label. */ |
3272 | 3393 |
3273 static inline void | 3394 static inline void |
3274 gimple_switch_set_label (gimple gs, unsigned index, tree label) | 3395 gimple_switch_set_label (gimple gs, unsigned index, tree label) |
3275 { | 3396 { |
3276 GIMPLE_CHECK (gs, GIMPLE_SWITCH); | 3397 GIMPLE_CHECK (gs, GIMPLE_SWITCH); |
3277 gcc_assert (gimple_num_ops (gs) > index + 1); | 3398 gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1 |
3278 gcc_assert (label == NULL_TREE || TREE_CODE (label) == CASE_LABEL_EXPR); | 3399 && (label == NULL_TREE |
3400 || TREE_CODE (label) == CASE_LABEL_EXPR)); | |
3279 gimple_set_op (gs, index + 1, label); | 3401 gimple_set_op (gs, index + 1, label); |
3280 } | 3402 } |
3281 | 3403 |
3282 /* Return the default label for a switch statement. */ | 3404 /* Return the default label for a switch statement. */ |
3283 | 3405 |
3318 | 3440 |
3319 static inline tree | 3441 static inline tree |
3320 gimple_debug_bind_get_var (gimple dbg) | 3442 gimple_debug_bind_get_var (gimple dbg) |
3321 { | 3443 { |
3322 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3444 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3323 gcc_assert (gimple_debug_bind_p (dbg)); | 3445 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3324 return gimple_op (dbg, 0); | 3446 return gimple_op (dbg, 0); |
3325 } | 3447 } |
3326 | 3448 |
3327 /* Return the value bound to the variable in a GIMPLE_DEBUG bind | 3449 /* Return the value bound to the variable in a GIMPLE_DEBUG bind |
3328 statement. */ | 3450 statement. */ |
3329 | 3451 |
3330 static inline tree | 3452 static inline tree |
3331 gimple_debug_bind_get_value (gimple dbg) | 3453 gimple_debug_bind_get_value (gimple dbg) |
3332 { | 3454 { |
3333 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3455 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3334 gcc_assert (gimple_debug_bind_p (dbg)); | 3456 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3335 return gimple_op (dbg, 1); | 3457 return gimple_op (dbg, 1); |
3336 } | 3458 } |
3337 | 3459 |
3338 /* Return a pointer to the value bound to the variable in a | 3460 /* Return a pointer to the value bound to the variable in a |
3339 GIMPLE_DEBUG bind statement. */ | 3461 GIMPLE_DEBUG bind statement. */ |
3340 | 3462 |
3341 static inline tree * | 3463 static inline tree * |
3342 gimple_debug_bind_get_value_ptr (gimple dbg) | 3464 gimple_debug_bind_get_value_ptr (gimple dbg) |
3343 { | 3465 { |
3344 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3466 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3345 gcc_assert (gimple_debug_bind_p (dbg)); | 3467 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3346 return gimple_op_ptr (dbg, 1); | 3468 return gimple_op_ptr (dbg, 1); |
3347 } | 3469 } |
3348 | 3470 |
3349 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */ | 3471 /* Set the variable bound in a GIMPLE_DEBUG bind statement. */ |
3350 | 3472 |
3351 static inline void | 3473 static inline void |
3352 gimple_debug_bind_set_var (gimple dbg, tree var) | 3474 gimple_debug_bind_set_var (gimple dbg, tree var) |
3353 { | 3475 { |
3354 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3476 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3355 gcc_assert (gimple_debug_bind_p (dbg)); | 3477 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3356 gimple_set_op (dbg, 0, var); | 3478 gimple_set_op (dbg, 0, var); |
3357 } | 3479 } |
3358 | 3480 |
3359 /* Set the value bound to the variable in a GIMPLE_DEBUG bind | 3481 /* Set the value bound to the variable in a GIMPLE_DEBUG bind |
3360 statement. */ | 3482 statement. */ |
3361 | 3483 |
3362 static inline void | 3484 static inline void |
3363 gimple_debug_bind_set_value (gimple dbg, tree value) | 3485 gimple_debug_bind_set_value (gimple dbg, tree value) |
3364 { | 3486 { |
3365 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3487 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3366 gcc_assert (gimple_debug_bind_p (dbg)); | 3488 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3367 gimple_set_op (dbg, 1, value); | 3489 gimple_set_op (dbg, 1, value); |
3368 } | 3490 } |
3369 | 3491 |
3370 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was | 3492 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was |
3371 optimized away. */ | 3493 optimized away. */ |
3376 | 3498 |
3377 static inline void | 3499 static inline void |
3378 gimple_debug_bind_reset_value (gimple dbg) | 3500 gimple_debug_bind_reset_value (gimple dbg) |
3379 { | 3501 { |
3380 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3502 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3381 gcc_assert (gimple_debug_bind_p (dbg)); | 3503 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3382 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE); | 3504 gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE); |
3383 } | 3505 } |
3384 | 3506 |
3385 /* Return true if the GIMPLE_DEBUG bind statement is bound to a | 3507 /* Return true if the GIMPLE_DEBUG bind statement is bound to a |
3386 value. */ | 3508 value. */ |
3387 | 3509 |
3388 static inline bool | 3510 static inline bool |
3389 gimple_debug_bind_has_value_p (gimple dbg) | 3511 gimple_debug_bind_has_value_p (gimple dbg) |
3390 { | 3512 { |
3391 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); | 3513 GIMPLE_CHECK (dbg, GIMPLE_DEBUG); |
3392 gcc_assert (gimple_debug_bind_p (dbg)); | 3514 gcc_gimple_checking_assert (gimple_debug_bind_p (dbg)); |
3393 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE; | 3515 return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE; |
3394 } | 3516 } |
3395 | 3517 |
3396 #undef GIMPLE_DEBUG_BIND_NOVALUE | 3518 #undef GIMPLE_DEBUG_BIND_NOVALUE |
3397 | 3519 |
3486 | 3608 |
3487 static inline tree | 3609 static inline tree |
3488 gimple_omp_for_index (const_gimple gs, size_t i) | 3610 gimple_omp_for_index (const_gimple gs, size_t i) |
3489 { | 3611 { |
3490 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3612 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3491 gcc_assert (i < gs->gimple_omp_for.collapse); | 3613 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3492 return gs->gimple_omp_for.iter[i].index; | 3614 return gs->gimple_omp_for.iter[i].index; |
3493 } | 3615 } |
3494 | 3616 |
3495 | 3617 |
3496 /* Return a pointer to the index variable for OMP_FOR GS. */ | 3618 /* Return a pointer to the index variable for OMP_FOR GS. */ |
3497 | 3619 |
3498 static inline tree * | 3620 static inline tree * |
3499 gimple_omp_for_index_ptr (gimple gs, size_t i) | 3621 gimple_omp_for_index_ptr (gimple gs, size_t i) |
3500 { | 3622 { |
3501 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3623 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3502 gcc_assert (i < gs->gimple_omp_for.collapse); | 3624 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3503 return &gs->gimple_omp_for.iter[i].index; | 3625 return &gs->gimple_omp_for.iter[i].index; |
3504 } | 3626 } |
3505 | 3627 |
3506 | 3628 |
3507 /* Set INDEX to be the index variable for OMP_FOR GS. */ | 3629 /* Set INDEX to be the index variable for OMP_FOR GS. */ |
3508 | 3630 |
3509 static inline void | 3631 static inline void |
3510 gimple_omp_for_set_index (gimple gs, size_t i, tree index) | 3632 gimple_omp_for_set_index (gimple gs, size_t i, tree index) |
3511 { | 3633 { |
3512 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3634 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3513 gcc_assert (i < gs->gimple_omp_for.collapse); | 3635 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3514 gs->gimple_omp_for.iter[i].index = index; | 3636 gs->gimple_omp_for.iter[i].index = index; |
3515 } | 3637 } |
3516 | 3638 |
3517 | 3639 |
3518 /* Return the initial value for OMP_FOR GS. */ | 3640 /* Return the initial value for OMP_FOR GS. */ |
3519 | 3641 |
3520 static inline tree | 3642 static inline tree |
3521 gimple_omp_for_initial (const_gimple gs, size_t i) | 3643 gimple_omp_for_initial (const_gimple gs, size_t i) |
3522 { | 3644 { |
3523 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3645 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3524 gcc_assert (i < gs->gimple_omp_for.collapse); | 3646 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3525 return gs->gimple_omp_for.iter[i].initial; | 3647 return gs->gimple_omp_for.iter[i].initial; |
3526 } | 3648 } |
3527 | 3649 |
3528 | 3650 |
3529 /* Return a pointer to the initial value for OMP_FOR GS. */ | 3651 /* Return a pointer to the initial value for OMP_FOR GS. */ |
3530 | 3652 |
3531 static inline tree * | 3653 static inline tree * |
3532 gimple_omp_for_initial_ptr (gimple gs, size_t i) | 3654 gimple_omp_for_initial_ptr (gimple gs, size_t i) |
3533 { | 3655 { |
3534 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3656 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3535 gcc_assert (i < gs->gimple_omp_for.collapse); | 3657 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3536 return &gs->gimple_omp_for.iter[i].initial; | 3658 return &gs->gimple_omp_for.iter[i].initial; |
3537 } | 3659 } |
3538 | 3660 |
3539 | 3661 |
3540 /* Set INITIAL to be the initial value for OMP_FOR GS. */ | 3662 /* Set INITIAL to be the initial value for OMP_FOR GS. */ |
3541 | 3663 |
3542 static inline void | 3664 static inline void |
3543 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial) | 3665 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial) |
3544 { | 3666 { |
3545 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3667 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3546 gcc_assert (i < gs->gimple_omp_for.collapse); | 3668 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3547 gs->gimple_omp_for.iter[i].initial = initial; | 3669 gs->gimple_omp_for.iter[i].initial = initial; |
3548 } | 3670 } |
3549 | 3671 |
3550 | 3672 |
3551 /* Return the final value for OMP_FOR GS. */ | 3673 /* Return the final value for OMP_FOR GS. */ |
3552 | 3674 |
3553 static inline tree | 3675 static inline tree |
3554 gimple_omp_for_final (const_gimple gs, size_t i) | 3676 gimple_omp_for_final (const_gimple gs, size_t i) |
3555 { | 3677 { |
3556 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3678 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3557 gcc_assert (i < gs->gimple_omp_for.collapse); | 3679 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3558 return gs->gimple_omp_for.iter[i].final; | 3680 return gs->gimple_omp_for.iter[i].final; |
3559 } | 3681 } |
3560 | 3682 |
3561 | 3683 |
3562 /* Return a pointer to the final value for OMP_FOR GS. */ | 3684 /* Return a pointer to the final value for OMP_FOR GS. */ |
3563 | 3685 |
3564 static inline tree * | 3686 static inline tree * |
3565 gimple_omp_for_final_ptr (gimple gs, size_t i) | 3687 gimple_omp_for_final_ptr (gimple gs, size_t i) |
3566 { | 3688 { |
3567 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3689 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3568 gcc_assert (i < gs->gimple_omp_for.collapse); | 3690 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3569 return &gs->gimple_omp_for.iter[i].final; | 3691 return &gs->gimple_omp_for.iter[i].final; |
3570 } | 3692 } |
3571 | 3693 |
3572 | 3694 |
3573 /* Set FINAL to be the final value for OMP_FOR GS. */ | 3695 /* Set FINAL to be the final value for OMP_FOR GS. */ |
3574 | 3696 |
3575 static inline void | 3697 static inline void |
3576 gimple_omp_for_set_final (gimple gs, size_t i, tree final) | 3698 gimple_omp_for_set_final (gimple gs, size_t i, tree final) |
3577 { | 3699 { |
3578 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3700 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3579 gcc_assert (i < gs->gimple_omp_for.collapse); | 3701 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3580 gs->gimple_omp_for.iter[i].final = final; | 3702 gs->gimple_omp_for.iter[i].final = final; |
3581 } | 3703 } |
3582 | 3704 |
3583 | 3705 |
3584 /* Return the increment value for OMP_FOR GS. */ | 3706 /* Return the increment value for OMP_FOR GS. */ |
3585 | 3707 |
3586 static inline tree | 3708 static inline tree |
3587 gimple_omp_for_incr (const_gimple gs, size_t i) | 3709 gimple_omp_for_incr (const_gimple gs, size_t i) |
3588 { | 3710 { |
3589 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3711 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3590 gcc_assert (i < gs->gimple_omp_for.collapse); | 3712 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3591 return gs->gimple_omp_for.iter[i].incr; | 3713 return gs->gimple_omp_for.iter[i].incr; |
3592 } | 3714 } |
3593 | 3715 |
3594 | 3716 |
3595 /* Return a pointer to the increment value for OMP_FOR GS. */ | 3717 /* Return a pointer to the increment value for OMP_FOR GS. */ |
3596 | 3718 |
3597 static inline tree * | 3719 static inline tree * |
3598 gimple_omp_for_incr_ptr (gimple gs, size_t i) | 3720 gimple_omp_for_incr_ptr (gimple gs, size_t i) |
3599 { | 3721 { |
3600 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3722 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3601 gcc_assert (i < gs->gimple_omp_for.collapse); | 3723 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3602 return &gs->gimple_omp_for.iter[i].incr; | 3724 return &gs->gimple_omp_for.iter[i].incr; |
3603 } | 3725 } |
3604 | 3726 |
3605 | 3727 |
3606 /* Set INCR to be the increment value for OMP_FOR GS. */ | 3728 /* Set INCR to be the increment value for OMP_FOR GS. */ |
3607 | 3729 |
3608 static inline void | 3730 static inline void |
3609 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr) | 3731 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr) |
3610 { | 3732 { |
3611 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 3733 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
3612 gcc_assert (i < gs->gimple_omp_for.collapse); | 3734 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
3613 gs->gimple_omp_for.iter[i].incr = incr; | 3735 gs->gimple_omp_for.iter[i].incr = incr; |
3614 } | 3736 } |
3615 | 3737 |
3616 | 3738 |
3617 /* Return the sequence of statements to execute before the OMP_FOR | 3739 /* Return the sequence of statements to execute before the OMP_FOR |
4109 | 4231 |
4110 static inline void | 4232 static inline void |
4111 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond) | 4233 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond) |
4112 { | 4234 { |
4113 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 4235 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
4114 gcc_assert (TREE_CODE_CLASS (cond) == tcc_comparison); | 4236 gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison |
4115 gcc_assert (i < gs->gimple_omp_for.collapse); | 4237 && i < gs->gimple_omp_for.collapse); |
4116 gs->gimple_omp_for.iter[i].cond = cond; | 4238 gs->gimple_omp_for.iter[i].cond = cond; |
4117 } | 4239 } |
4118 | 4240 |
4119 | 4241 |
4120 /* Return the condition code associated with OMP_FOR GS. */ | 4242 /* Return the condition code associated with OMP_FOR GS. */ |
4121 | 4243 |
4122 static inline enum tree_code | 4244 static inline enum tree_code |
4123 gimple_omp_for_cond (const_gimple gs, size_t i) | 4245 gimple_omp_for_cond (const_gimple gs, size_t i) |
4124 { | 4246 { |
4125 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); | 4247 GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); |
4126 gcc_assert (i < gs->gimple_omp_for.collapse); | 4248 gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse); |
4127 return gs->gimple_omp_for.iter[i].cond; | 4249 return gs->gimple_omp_for.iter[i].cond; |
4128 } | 4250 } |
4129 | 4251 |
4130 | 4252 |
4131 /* Set the value being stored in an atomic store. */ | 4253 /* Set the value being stored in an atomic store. */ |
4280 | 4402 |
4281 static inline tree * | 4403 static inline tree * |
4282 gimple_return_retval_ptr (const_gimple gs) | 4404 gimple_return_retval_ptr (const_gimple gs) |
4283 { | 4405 { |
4284 GIMPLE_CHECK (gs, GIMPLE_RETURN); | 4406 GIMPLE_CHECK (gs, GIMPLE_RETURN); |
4285 gcc_assert (gimple_num_ops (gs) == 1); | |
4286 return gimple_op_ptr (gs, 0); | 4407 return gimple_op_ptr (gs, 0); |
4287 } | 4408 } |
4288 | 4409 |
4289 /* Return the return value for GIMPLE_RETURN GS. */ | 4410 /* Return the return value for GIMPLE_RETURN GS. */ |
4290 | 4411 |
4291 static inline tree | 4412 static inline tree |
4292 gimple_return_retval (const_gimple gs) | 4413 gimple_return_retval (const_gimple gs) |
4293 { | 4414 { |
4294 GIMPLE_CHECK (gs, GIMPLE_RETURN); | 4415 GIMPLE_CHECK (gs, GIMPLE_RETURN); |
4295 gcc_assert (gimple_num_ops (gs) == 1); | |
4296 return gimple_op (gs, 0); | 4416 return gimple_op (gs, 0); |
4297 } | 4417 } |
4298 | 4418 |
4299 | 4419 |
4300 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */ | 4420 /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */ |
4301 | 4421 |
4302 static inline void | 4422 static inline void |
4303 gimple_return_set_retval (gimple gs, tree retval) | 4423 gimple_return_set_retval (gimple gs, tree retval) |
4304 { | 4424 { |
4305 GIMPLE_CHECK (gs, GIMPLE_RETURN); | 4425 GIMPLE_CHECK (gs, GIMPLE_RETURN); |
4306 gcc_assert (gimple_num_ops (gs) == 1); | |
4307 gcc_assert (retval == NULL_TREE | |
4308 || TREE_CODE (retval) == RESULT_DECL | |
4309 || is_gimple_val (retval)); | |
4310 gimple_set_op (gs, 0, retval); | 4426 gimple_set_op (gs, 0, retval); |
4311 } | 4427 } |
4312 | 4428 |
4313 | 4429 |
4314 /* Returns true when the gimple statment STMT is any of the OpenMP types. */ | 4430 /* Returns true when the gimple statment STMT is any of the OpenMP types. */ |
4788 } | 4904 } |
4789 #endif /* GATHER_STATISTICS */ | 4905 #endif /* GATHER_STATISTICS */ |
4790 | 4906 |
4791 extern void dump_gimple_statistics (void); | 4907 extern void dump_gimple_statistics (void); |
4792 | 4908 |
4909 /* In gimple-fold.c. */ | |
4910 void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree); | |
4911 tree gimple_fold_builtin (gimple); | |
4912 bool fold_stmt (gimple_stmt_iterator *); | |
4913 bool fold_stmt_inplace (gimple); | |
4914 tree maybe_fold_offset_to_address (location_t, tree, tree, tree); | |
4915 tree maybe_fold_offset_to_reference (location_t, tree, tree, tree); | |
4916 tree maybe_fold_stmt_addition (location_t, tree, tree, tree); | |
4917 tree get_symbol_constant_value (tree); | |
4918 tree canonicalize_constructor_val (tree); | |
4919 bool may_propagate_address_into_dereference (tree, tree); | |
4920 extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree, | |
4921 enum tree_code, tree, tree); | |
4922 extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree, | |
4923 enum tree_code, tree, tree); | |
4924 | |
4793 #endif /* GCC_GIMPLE_H */ | 4925 #endif /* GCC_GIMPLE_H */ |