OSDN Git Service

8ecf7eb0a4edde50d95dc8c461e2ca906de0a2ed
[pf3gnuchains/gcc-fork.git] / gcc / gimple.h
1 /* Gimple IR definitions.
2
3    Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4    Contributed by Aldy Hernandez <aldyh@redhat.com>
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3.  If not see
20 <http://www.gnu.org/licenses/>.  */
21
22 #ifndef GCC_GIMPLE_H
23 #define GCC_GIMPLE_H
24
25 #include "pointer-set.h"
26 #include "vec.h"
27 #include "ggc.h"
28 #include "tm.h"
29 #include "hard-reg-set.h"
30 #include "basic-block.h"
31 #include "tree-ssa-operands.h"
32 #include "tree-ssa-alias.h"
33
34 DEF_VEC_P(gimple);
35 DEF_VEC_ALLOC_P(gimple,heap);
36 DEF_VEC_ALLOC_P(gimple,gc);
37
38 typedef gimple *gimple_p;
39 DEF_VEC_P(gimple_p);
40 DEF_VEC_ALLOC_P(gimple_p,heap);
41
42 DEF_VEC_P(gimple_seq);
43 DEF_VEC_ALLOC_P(gimple_seq,gc);
44 DEF_VEC_ALLOC_P(gimple_seq,heap);
45
46 /* For each block, the PHI nodes that need to be rewritten are stored into
47    these vectors.  */
48 typedef VEC(gimple, heap) *gimple_vec;
49 DEF_VEC_P (gimple_vec);
50 DEF_VEC_ALLOC_P (gimple_vec, heap);
51
52 enum gimple_code {
53 #define DEFGSCODE(SYM, STRING, STRUCT)  SYM,
54 #include "gimple.def"
55 #undef DEFGSCODE
56     LAST_AND_UNUSED_GIMPLE_CODE
57 };
58
59 extern const char *const gimple_code_name[];
60 extern const unsigned char gimple_rhs_class_table[];
61
62 /* Error out if a gimple tuple is addressed incorrectly.  */
63 #if defined ENABLE_GIMPLE_CHECKING
64 extern void gimple_check_failed (const_gimple, const char *, int,          \
65                                  const char *, enum gimple_code,           \
66                                  enum tree_code) ATTRIBUTE_NORETURN;
67
68 #define GIMPLE_CHECK(GS, CODE)                                          \
69   do {                                                                  \
70     const_gimple __gs = (GS);                                           \
71     if (gimple_code (__gs) != (CODE))                                   \
72       gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__,      \
73                            (CODE), ERROR_MARK);                         \
74   } while (0)
75 #else  /* not ENABLE_GIMPLE_CHECKING  */
76 #define GIMPLE_CHECK(GS, CODE)                  (void)0
77 #endif
78
79 /* Class of GIMPLE expressions suitable for the RHS of assignments.  See
80    get_gimple_rhs_class.  */
81 enum gimple_rhs_class
82 {
83   GIMPLE_INVALID_RHS,   /* The expression cannot be used on the RHS.  */
84   GIMPLE_BINARY_RHS,    /* The expression is a binary operation.  */
85   GIMPLE_UNARY_RHS,     /* The expression is a unary operation.  */
86   GIMPLE_SINGLE_RHS     /* The expression is a single object (an SSA
87                            name, a _DECL, a _REF, etc.  */
88 };
89
90 /* Specific flags for individual GIMPLE statements.  These flags are
91    always stored in gimple_statement_base.subcode and they may only be
92    defined for statement codes that do not use sub-codes.
93
94    Values for the masks can overlap as long as the overlapping values
95    are never used in the same statement class.
96
97    The maximum mask value that can be defined is 1 << 15 (i.e., each
98    statement code can hold up to 16 bitflags).
99
100    Keep this list sorted.  */
101 enum gf_mask {
102     GF_ASM_INPUT                = 1 << 0,
103     GF_ASM_VOLATILE             = 1 << 1,
104     GF_CALL_CANNOT_INLINE       = 1 << 0,
105     GF_CALL_FROM_THUNK          = 1 << 1,
106     GF_CALL_RETURN_SLOT_OPT     = 1 << 2,
107     GF_CALL_TAILCALL            = 1 << 3,
108     GF_CALL_VA_ARG_PACK         = 1 << 4,
109     GF_OMP_PARALLEL_COMBINED    = 1 << 0,
110
111     /* True on an GIMPLE_OMP_RETURN statement if the return does not require
112        a thread synchronization via some sort of barrier.  The exact barrier
113        that would otherwise be emitted is dependent on the OMP statement with
114        which this return is associated.  */
115     GF_OMP_RETURN_NOWAIT        = 1 << 0,
116
117     GF_OMP_SECTION_LAST         = 1 << 0,
118     GF_PREDICT_TAKEN            = 1 << 15
119 };
120
121 /* Currently, there's only one type of gimple debug stmt.  Others are
122    envisioned, for example, to enable the generation of is_stmt notes
123    in line number information, to mark sequence points, etc.  This
124    subcode is to be used to tell them apart.  */
125 enum gimple_debug_subcode {
126   GIMPLE_DEBUG_BIND = 0
127 };
128
129 /* Masks for selecting a pass local flag (PLF) to work on.  These
130    masks are used by gimple_set_plf and gimple_plf.  */
131 enum plf_mask {
132     GF_PLF_1    = 1 << 0,
133     GF_PLF_2    = 1 << 1
134 };
135
136 /* A node in a gimple_seq_d.  */
137 struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) gimple_seq_node_d {
138   gimple stmt;
139   struct gimple_seq_node_d *prev;
140   struct gimple_seq_node_d *next;
141 };
142
143 /* A double-linked sequence of gimple statements.  */
144 struct GTY ((chain_next ("%h.next_free"))) gimple_seq_d {
145   /* First and last statements in the sequence.  */
146   gimple_seq_node first;
147   gimple_seq_node last;
148
149   /* Sequences are created/destroyed frequently.  To minimize
150      allocation activity, deallocated sequences are kept in a pool of
151      available sequences.  This is the pointer to the next free
152      sequence in the pool.  */
153   gimple_seq next_free;
154 };
155
156
157 /* Return the first node in GIMPLE sequence S.  */
158
159 static inline gimple_seq_node
160 gimple_seq_first (const_gimple_seq s)
161 {
162   return s ? s->first : NULL;
163 }
164
165
166 /* Return the first statement in GIMPLE sequence S.  */
167
168 static inline gimple
169 gimple_seq_first_stmt (const_gimple_seq s)
170 {
171   gimple_seq_node n = gimple_seq_first (s);
172   return (n) ? n->stmt : NULL;
173 }
174
175
176 /* Return the last node in GIMPLE sequence S.  */
177
178 static inline gimple_seq_node
179 gimple_seq_last (const_gimple_seq s)
180 {
181   return s ? s->last : NULL;
182 }
183
184
185 /* Return the last statement in GIMPLE sequence S.  */
186
187 static inline gimple
188 gimple_seq_last_stmt (const_gimple_seq s)
189 {
190   gimple_seq_node n = gimple_seq_last (s);
191   return (n) ? n->stmt : NULL;
192 }
193
194
195 /* Set the last node in GIMPLE sequence S to LAST.  */
196
197 static inline void
198 gimple_seq_set_last (gimple_seq s, gimple_seq_node last)
199 {
200   s->last = last;
201 }
202
203
204 /* Set the first node in GIMPLE sequence S to FIRST.  */
205
206 static inline void
207 gimple_seq_set_first (gimple_seq s, gimple_seq_node first)
208 {
209   s->first = first;
210 }
211
212
213 /* Return true if GIMPLE sequence S is empty.  */
214
215 static inline bool
216 gimple_seq_empty_p (const_gimple_seq s)
217 {
218   return s == NULL || s->first == NULL;
219 }
220
221
222 void gimple_seq_add_stmt (gimple_seq *, gimple);
223
224 /* Link gimple statement GS to the end of the sequence *SEQ_P.  If
225    *SEQ_P is NULL, a new sequence is allocated.  This function is
226    similar to gimple_seq_add_stmt, but does not scan the operands.
227    During gimplification, we need to manipulate statement sequences
228    before the def/use vectors have been constructed.  */
229 void gimplify_seq_add_stmt (gimple_seq *, gimple);
230
231 /* Allocate a new sequence and initialize its first element with STMT.  */
232
233 static inline gimple_seq
234 gimple_seq_alloc_with_stmt (gimple stmt)
235 {
236   gimple_seq seq = NULL;
237   gimple_seq_add_stmt (&seq, stmt);
238   return seq;
239 }
240
241
242 /* Returns the sequence of statements in BB.  */
243
244 static inline gimple_seq
245 bb_seq (const_basic_block bb)
246 {
247   return (!(bb->flags & BB_RTL) && bb->il.gimple) ? bb->il.gimple->seq : NULL;
248 }
249
250
251 /* Sets the sequence of statements in BB to SEQ.  */
252
253 static inline void
254 set_bb_seq (basic_block bb, gimple_seq seq)
255 {
256   gcc_assert (!(bb->flags & BB_RTL));
257   bb->il.gimple->seq = seq;
258 }
259
260 /* Iterator object for GIMPLE statement sequences.  */
261
262 typedef struct
263 {
264   /* Sequence node holding the current statement.  */
265   gimple_seq_node ptr;
266
267   /* Sequence and basic block holding the statement.  These fields
268      are necessary to handle edge cases such as when statement is
269      added to an empty basic block or when the last statement of a
270      block/sequence is removed.  */
271   gimple_seq seq;
272   basic_block bb;
273 } gimple_stmt_iterator;
274
275
276 /* Data structure definitions for GIMPLE tuples.  NOTE: word markers
277    are for 64 bit hosts.  */
278
279 struct GTY(()) gimple_statement_base {
280   /* [ WORD 1 ]
281      Main identifying code for a tuple.  */
282   ENUM_BITFIELD(gimple_code) code : 8;
283
284   /* Nonzero if a warning should not be emitted on this tuple.  */
285   unsigned int no_warning       : 1;
286
287   /* Nonzero if this tuple has been visited.  Passes are responsible
288      for clearing this bit before using it.  */
289   unsigned int visited          : 1;
290
291   /* Nonzero if this tuple represents a non-temporal move.  */
292   unsigned int nontemporal_move : 1;
293
294   /* Pass local flags.  These flags are free for any pass to use as
295      they see fit.  Passes should not assume that these flags contain
296      any useful value when the pass starts.  Any initial state that
297      the pass requires should be set on entry to the pass.  See
298      gimple_set_plf and gimple_plf for usage.  */
299   unsigned int plf              : 2;
300
301   /* Nonzero if this statement has been modified and needs to have its
302      operands rescanned.  */
303   unsigned modified             : 1;
304
305   /* Nonzero if this statement contains volatile operands.  */
306   unsigned has_volatile_ops     : 1;
307
308   /* Padding to get subcode to 16 bit alignment.  */
309   unsigned pad                  : 1;
310
311   /* The SUBCODE field can be used for tuple-specific flags for tuples
312      that do not require subcodes.  Note that SUBCODE should be at
313      least as wide as tree codes, as several tuples store tree codes
314      in there.  */
315   unsigned int subcode          : 16;
316
317   /* UID of this statement.  This is used by passes that want to
318      assign IDs to statements.  It must be assigned and used by each
319      pass.  By default it should be assumed to contain garbage.  */
320   unsigned uid;
321
322   /* [ WORD 2 ]
323      Locus information for debug info.  */
324   location_t location;
325
326   /* Number of operands in this tuple.  */
327   unsigned num_ops;
328
329   /* [ WORD 3 ]
330      Basic block holding this statement.  */
331   struct basic_block_def *bb;
332
333   /* [ WORD 4 ]
334      Lexical block holding this statement.  */
335   tree block;
336 };
337
338
339 /* Base structure for tuples with operands.  */
340
341 struct GTY(()) gimple_statement_with_ops_base
342 {
343   /* [ WORD 1-4 ]  */
344   struct gimple_statement_base gsbase;
345
346   /* [ WORD 5-6 ]
347      SSA operand vectors.  NOTE: It should be possible to
348      amalgamate these vectors with the operand vector OP.  However,
349      the SSA operand vectors are organized differently and contain
350      more information (like immediate use chaining).  */
351   struct def_optype_d GTY((skip (""))) *def_ops;
352   struct use_optype_d GTY((skip (""))) *use_ops;
353 };
354
355
356 /* Statements that take register operands.  */
357
358 struct GTY(()) gimple_statement_with_ops
359 {
360   /* [ WORD 1-6 ]  */
361   struct gimple_statement_with_ops_base opbase;
362
363   /* [ WORD 7 ]
364      Operand vector.  NOTE!  This must always be the last field
365      of this structure.  In particular, this means that this
366      structure cannot be embedded inside another one.  */
367   tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1];
368 };
369
370
371 /* Base for statements that take both memory and register operands.  */
372
373 struct GTY(()) gimple_statement_with_memory_ops_base
374 {
375   /* [ WORD 1-6 ]  */
376   struct gimple_statement_with_ops_base opbase;
377
378   /* [ WORD 7-8 ]
379      Virtual operands for this statement.  The GC will pick them
380      up via the ssa_names array.  */
381   tree GTY((skip (""))) vdef;
382   tree GTY((skip (""))) vuse;
383 };
384
385
386 /* Statements that take both memory and register operands.  */
387
388 struct GTY(()) gimple_statement_with_memory_ops
389 {
390   /* [ WORD 1-8 ]  */
391   struct gimple_statement_with_memory_ops_base membase;
392
393   /* [ WORD 9 ]
394      Operand vector.  NOTE!  This must always be the last field
395      of this structure.  In particular, this means that this
396      structure cannot be embedded inside another one.  */
397   tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
398 };
399
400
401 /* Call statements that take both memory and register operands.  */
402
403 struct GTY(()) gimple_statement_call
404 {
405   /* [ WORD 1-8 ]  */
406   struct gimple_statement_with_memory_ops_base membase;
407
408   /* [ WORD 9-12 ]  */
409   struct pt_solution call_used;
410   struct pt_solution call_clobbered;
411
412   /* [ WORD 13 ]
413      Operand vector.  NOTE!  This must always be the last field
414      of this structure.  In particular, this means that this
415      structure cannot be embedded inside another one.  */
416   tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
417 };
418
419
420 /* OpenMP statements (#pragma omp).  */
421
422 struct GTY(()) gimple_statement_omp {
423   /* [ WORD 1-4 ]  */
424   struct gimple_statement_base gsbase;
425
426   /* [ WORD 5 ]  */
427   gimple_seq body;
428 };
429
430
431 /* GIMPLE_BIND */
432
433 struct GTY(()) gimple_statement_bind {
434   /* [ WORD 1-4 ]  */
435   struct gimple_statement_base gsbase;
436
437   /* [ WORD 5 ]
438      Variables declared in this scope.  */
439   tree vars;
440
441   /* [ WORD 6 ]
442      This is different than the BLOCK field in gimple_statement_base,
443      which is analogous to TREE_BLOCK (i.e., the lexical block holding
444      this statement).  This field is the equivalent of BIND_EXPR_BLOCK
445      in tree land (i.e., the lexical scope defined by this bind).  See
446      gimple-low.c.  */
447   tree block;
448
449   /* [ WORD 7 ]  */
450   gimple_seq body;
451 };
452
453
454 /* GIMPLE_CATCH */
455
456 struct GTY(()) gimple_statement_catch {
457   /* [ WORD 1-4 ]  */
458   struct gimple_statement_base gsbase;
459
460   /* [ WORD 5 ]  */
461   tree types;
462
463   /* [ WORD 6 ]  */
464   gimple_seq handler;
465 };
466
467
468 /* GIMPLE_EH_FILTER */
469
470 struct GTY(()) gimple_statement_eh_filter {
471   /* [ WORD 1-4 ]  */
472   struct gimple_statement_base gsbase;
473
474   /* [ WORD 5 ]
475      Filter types.  */
476   tree types;
477
478   /* [ WORD 6 ]
479      Failure actions.  */
480   gimple_seq failure;
481 };
482
483
484 /* GIMPLE_EH_MUST_NOT_THROW */
485
486 struct GTY(()) gimple_statement_eh_mnt {
487   /* [ WORD 1-4 ]  */
488   struct gimple_statement_base gsbase;
489
490   /* [ WORD 5 ] Abort function decl.  */
491   tree fndecl;
492 };
493
494 /* GIMPLE_PHI */
495
496 struct GTY(()) gimple_statement_phi {
497   /* [ WORD 1-4 ]  */
498   struct gimple_statement_base gsbase;
499
500   /* [ WORD 5 ]  */
501   unsigned capacity;
502   unsigned nargs;
503
504   /* [ WORD 6 ]  */
505   tree result;
506
507   /* [ WORD 7 ]  */
508   struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
509 };
510
511
512 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
513
514 struct GTY(()) gimple_statement_eh_ctrl
515 {
516   /* [ WORD 1-4 ]  */
517   struct gimple_statement_base gsbase;
518
519   /* [ WORD 5 ]
520      Exception region number.  */
521   int region;
522 };
523
524
525 /* GIMPLE_TRY */
526
527 struct GTY(()) gimple_statement_try {
528   /* [ WORD 1-4 ]  */
529   struct gimple_statement_base gsbase;
530
531   /* [ WORD 5 ]
532      Expression to evaluate.  */
533   gimple_seq eval;
534
535   /* [ WORD 6 ]
536      Cleanup expression.  */
537   gimple_seq cleanup;
538 };
539
540 /* Kind of GIMPLE_TRY statements.  */
541 enum gimple_try_flags
542 {
543   /* A try/catch.  */
544   GIMPLE_TRY_CATCH = 1 << 0,
545
546   /* A try/finally.  */
547   GIMPLE_TRY_FINALLY = 1 << 1,
548   GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
549
550   /* Analogous to TRY_CATCH_IS_CLEANUP.  */
551   GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
552 };
553
554 /* GIMPLE_WITH_CLEANUP_EXPR */
555
556 struct GTY(()) gimple_statement_wce {
557   /* [ WORD 1-4 ]  */
558   struct gimple_statement_base gsbase;
559
560   /* Subcode: CLEANUP_EH_ONLY.  True if the cleanup should only be
561               executed if an exception is thrown, not on normal exit of its
562               scope.  This flag is analogous to the CLEANUP_EH_ONLY flag
563               in TARGET_EXPRs.  */
564
565   /* [ WORD 5 ]
566      Cleanup expression.  */
567   gimple_seq cleanup;
568 };
569
570
571 /* GIMPLE_ASM  */
572
573 struct GTY(()) gimple_statement_asm
574 {
575   /* [ WORD 1-8 ]  */
576   struct gimple_statement_with_memory_ops_base membase;
577
578   /* [ WORD 9 ]
579      __asm__ statement.  */
580   const char *string;
581
582   /* [ WORD 10 ]
583        Number of inputs, outputs, clobbers, labels.  */
584   unsigned char ni;
585   unsigned char no;
586   unsigned char nc;
587   unsigned char nl;
588
589   /* [ WORD 11 ]
590      Operand vector.  NOTE!  This must always be the last field
591      of this structure.  In particular, this means that this
592      structure cannot be embedded inside another one.  */
593   tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
594 };
595
596 /* GIMPLE_OMP_CRITICAL */
597
598 struct GTY(()) gimple_statement_omp_critical {
599   /* [ WORD 1-5 ]  */
600   struct gimple_statement_omp omp;
601
602   /* [ WORD 6 ]
603      Critical section name.  */
604   tree name;
605 };
606
607
608 struct GTY(()) gimple_omp_for_iter {
609   /* Condition code.  */
610   enum tree_code cond;
611
612   /* Index variable.  */
613   tree index;
614
615   /* Initial value.  */
616   tree initial;
617
618   /* Final value.  */
619   tree final;
620
621   /* Increment.  */
622   tree incr;
623 };
624
625 /* GIMPLE_OMP_FOR */
626
627 struct GTY(()) gimple_statement_omp_for {
628   /* [ WORD 1-5 ]  */
629   struct gimple_statement_omp omp;
630
631   /* [ WORD 6 ]  */
632   tree clauses;
633
634   /* [ WORD 7 ]
635      Number of elements in iter array.  */
636   size_t collapse;
637
638   /* [ WORD 8 ]  */
639   struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
640
641   /* [ WORD 9 ]
642      Pre-body evaluated before the loop body begins.  */
643   gimple_seq pre_body;
644 };
645
646
647 /* GIMPLE_OMP_PARALLEL */
648
649 struct GTY(()) gimple_statement_omp_parallel {
650   /* [ WORD 1-5 ]  */
651   struct gimple_statement_omp omp;
652
653   /* [ WORD 6 ]
654      Clauses.  */
655   tree clauses;
656
657   /* [ WORD 7 ]
658      Child function holding the body of the parallel region.  */
659   tree child_fn;
660
661   /* [ WORD 8 ]
662      Shared data argument.  */
663   tree data_arg;
664 };
665
666
667 /* GIMPLE_OMP_TASK */
668
669 struct GTY(()) gimple_statement_omp_task {
670   /* [ WORD 1-8 ]  */
671   struct gimple_statement_omp_parallel par;
672
673   /* [ WORD 9 ]
674      Child function holding firstprivate initialization if needed.  */
675   tree copy_fn;
676
677   /* [ WORD 10-11 ]
678      Size and alignment in bytes of the argument data block.  */
679   tree arg_size;
680   tree arg_align;
681 };
682
683
684 /* GIMPLE_OMP_SECTION */
685 /* Uses struct gimple_statement_omp.  */
686
687
688 /* GIMPLE_OMP_SECTIONS */
689
690 struct GTY(()) gimple_statement_omp_sections {
691   /* [ WORD 1-5 ]  */
692   struct gimple_statement_omp omp;
693
694   /* [ WORD 6 ]  */
695   tree clauses;
696
697   /* [ WORD 7 ]
698      The control variable used for deciding which of the sections to
699      execute.  */
700   tree control;
701 };
702
703 /* GIMPLE_OMP_CONTINUE.
704
705    Note: This does not inherit from gimple_statement_omp, because we
706          do not need the body field.  */
707
708 struct GTY(()) gimple_statement_omp_continue {
709   /* [ WORD 1-4 ]  */
710   struct gimple_statement_base gsbase;
711
712   /* [ WORD 5 ]  */
713   tree control_def;
714
715   /* [ WORD 6 ]  */
716   tree control_use;
717 };
718
719 /* GIMPLE_OMP_SINGLE */
720
721 struct GTY(()) gimple_statement_omp_single {
722   /* [ WORD 1-5 ]  */
723   struct gimple_statement_omp omp;
724
725   /* [ WORD 6 ]  */
726   tree clauses;
727 };
728
729
730 /* GIMPLE_OMP_ATOMIC_LOAD.
731    Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
732    contains a sequence, which we don't need here.  */
733
734 struct GTY(()) gimple_statement_omp_atomic_load {
735   /* [ WORD 1-4 ]  */
736   struct gimple_statement_base gsbase;
737
738   /* [ WORD 5-6 ]  */
739   tree rhs, lhs;
740 };
741
742 /* GIMPLE_OMP_ATOMIC_STORE.
743    See note on GIMPLE_OMP_ATOMIC_LOAD.  */
744
745 struct GTY(()) gimple_statement_omp_atomic_store {
746   /* [ WORD 1-4 ]  */
747   struct gimple_statement_base gsbase;
748
749   /* [ WORD 5 ]  */
750   tree val;
751 };
752
753 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP)   SYM,
754 enum gimple_statement_structure_enum {
755 #include "gsstruct.def"
756     LAST_GSS_ENUM
757 };
758 #undef DEFGSSTRUCT
759
760
761 /* Define the overall contents of a gimple tuple.  It may be any of the
762    structures declared above for various types of tuples.  */
763
764 union GTY ((desc ("gimple_statement_structure (&%h)"))) gimple_statement_d {
765   struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
766   struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
767   struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
768   struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
769   struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call;
770   struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
771   struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
772   struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch;
773   struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter;
774   struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt;
775   struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi;
776   struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl;
777   struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try;
778   struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce;
779   struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm;
780   struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical;
781   struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for;
782   struct gimple_statement_omp_parallel GTY ((tag ("GSS_OMP_PARALLEL"))) gimple_omp_parallel;
783   struct gimple_statement_omp_task GTY ((tag ("GSS_OMP_TASK"))) gimple_omp_task;
784   struct gimple_statement_omp_sections GTY ((tag ("GSS_OMP_SECTIONS"))) gimple_omp_sections;
785   struct gimple_statement_omp_single GTY ((tag ("GSS_OMP_SINGLE"))) gimple_omp_single;
786   struct gimple_statement_omp_continue GTY ((tag ("GSS_OMP_CONTINUE"))) gimple_omp_continue;
787   struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load;
788   struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store;
789 };
790
791 /* In gimple.c.  */
792
793 /* Offset in bytes to the location of the operand vector.
794    Zero if there is no operand vector for this tuple structure.  */
795 extern size_t const gimple_ops_offset_[];
796
797 /* Map GIMPLE codes to GSS codes.  */
798 extern enum gimple_statement_structure_enum const gss_for_code_[];
799
800 /* This variable holds the currently expanded gimple statement for purposes
801    of comminucating the profile info to the builtin expanders.  */
802 extern gimple currently_expanding_gimple_stmt;
803
804 gimple gimple_build_return (tree);
805
806 gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
807 #define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
808
809 void extract_ops_from_tree (tree, enum tree_code *, tree *, tree *);
810
811 gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree,
812                                           tree MEM_STAT_DECL);
813 #define gimple_build_assign_with_ops(c,o1,o2,o3) \
814   gimple_build_assign_with_ops_stat (c, o1, o2, o3 MEM_STAT_INFO)
815
816 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
817 #define gimple_build_debug_bind(var,val,stmt)                   \
818   gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
819
820 gimple gimple_build_call_vec (tree, VEC(tree, heap) *);
821 gimple gimple_build_call (tree, unsigned, ...);
822 gimple gimple_build_call_from_tree (tree);
823 gimple gimplify_assign (tree, tree, gimple_seq *);
824 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
825 gimple gimple_build_label (tree label);
826 gimple gimple_build_goto (tree dest);
827 gimple gimple_build_nop (void);
828 gimple gimple_build_bind (tree, gimple_seq, tree);
829 gimple gimple_build_asm_vec (const char *, VEC(tree,gc) *, VEC(tree,gc) *,
830                              VEC(tree,gc) *, VEC(tree,gc) *);
831 gimple gimple_build_catch (tree, gimple_seq);
832 gimple gimple_build_eh_filter (tree, gimple_seq);
833 gimple gimple_build_eh_must_not_throw (tree);
834 gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags);
835 gimple gimple_build_wce (gimple_seq);
836 gimple gimple_build_resx (int);
837 gimple gimple_build_eh_dispatch (int);
838 gimple gimple_build_switch_nlabels (unsigned, tree, tree);
839 gimple gimple_build_switch (unsigned, tree, tree, ...);
840 gimple gimple_build_switch_vec (tree, tree, VEC(tree,heap) *);
841 gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
842 gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
843 gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq);
844 gimple gimple_build_omp_critical (gimple_seq, tree);
845 gimple gimple_build_omp_section (gimple_seq);
846 gimple gimple_build_omp_continue (tree, tree);
847 gimple gimple_build_omp_master (gimple_seq);
848 gimple gimple_build_omp_return (bool);
849 gimple gimple_build_omp_ordered (gimple_seq);
850 gimple gimple_build_omp_sections (gimple_seq, tree);
851 gimple gimple_build_omp_sections_switch (void);
852 gimple gimple_build_omp_single (gimple_seq, tree);
853 gimple gimple_build_cdt (tree, tree);
854 gimple gimple_build_omp_atomic_load (tree, tree);
855 gimple gimple_build_omp_atomic_store (tree);
856 gimple gimple_build_predict (enum br_predictor, enum prediction);
857 enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
858 void sort_case_labels (VEC(tree,heap) *);
859 void gimple_set_body (tree, gimple_seq);
860 gimple_seq gimple_body (tree);
861 bool gimple_has_body_p (tree);
862 gimple_seq gimple_seq_alloc (void);
863 void gimple_seq_free (gimple_seq);
864 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
865 gimple_seq gimple_seq_copy (gimple_seq);
866 int gimple_call_flags (const_gimple);
867 int gimple_call_return_flags (const_gimple);
868 int gimple_call_arg_flags (const_gimple, unsigned);
869 void gimple_call_reset_alias_info (gimple);
870 bool gimple_assign_copy_p (gimple);
871 bool gimple_assign_ssa_name_copy_p (gimple);
872 bool gimple_assign_single_p (gimple);
873 bool gimple_assign_unary_nop_p (gimple);
874 void gimple_set_bb (gimple, struct basic_block_def *);
875 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
876 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
877                                      tree, tree);
878 tree gimple_get_lhs (const_gimple);
879 void gimple_set_lhs (gimple, tree);
880 void gimple_replace_lhs (gimple, tree);
881 gimple gimple_copy (gimple);
882 bool is_gimple_operand (const_tree);
883 void gimple_set_modified (gimple, bool);
884 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *);
885 gimple gimple_build_cond_from_tree (tree, tree, tree);
886 void gimple_cond_set_condition_from_tree (gimple, tree);
887 bool gimple_has_side_effects (const_gimple);
888 bool gimple_rhs_has_side_effects (const_gimple);
889 bool gimple_could_trap_p (gimple);
890 bool gimple_assign_rhs_could_trap_p (gimple);
891 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
892 bool empty_body_p (gimple_seq);
893 unsigned get_gimple_rhs_num_ops (enum tree_code);
894 #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
895 gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
896 const char *gimple_decl_printable_name (tree, int);
897 tree gimple_fold_obj_type_ref (tree, tree);
898 tree gimple_get_relevant_ref_binfo (tree ref, tree known_binfo);
899 tree gimple_fold_obj_type_ref_known_binfo (HOST_WIDE_INT, tree);
900
901 /* Returns true iff T is a valid GIMPLE statement.  */
902 extern bool is_gimple_stmt (tree);
903
904 /* Returns true iff TYPE is a valid type for a scalar register variable.  */
905 extern bool is_gimple_reg_type (tree);
906 /* Returns true iff T is a scalar register variable.  */
907 extern bool is_gimple_reg (tree);
908 /* Returns true iff T is any sort of variable.  */
909 extern bool is_gimple_variable (tree);
910 /* Returns true iff T is any sort of symbol.  */
911 extern bool is_gimple_id (tree);
912 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable).  */
913 extern bool is_gimple_min_lval (tree);
914 /* Returns true iff T is something whose address can be taken.  */
915 extern bool is_gimple_addressable (tree);
916 /* Returns true iff T is any valid GIMPLE lvalue.  */
917 extern bool is_gimple_lvalue (tree);
918
919 /* Returns true iff T is a GIMPLE address.  */
920 bool is_gimple_address (const_tree);
921 /* Returns true iff T is a GIMPLE invariant address.  */
922 bool is_gimple_invariant_address (const_tree);
923 /* Returns true iff T is a GIMPLE invariant address at interprocedural
924    level.  */
925 bool is_gimple_ip_invariant_address (const_tree);
926 /* Returns true iff T is a valid GIMPLE constant.  */
927 bool is_gimple_constant (const_tree);
928 /* Returns true iff T is a GIMPLE restricted function invariant.  */
929 extern bool is_gimple_min_invariant (const_tree);
930 /* Returns true iff T is a GIMPLE restricted interprecodural invariant.  */
931 extern bool is_gimple_ip_invariant (const_tree);
932 /* Returns true iff T is a GIMPLE rvalue.  */
933 extern bool is_gimple_val (tree);
934 /* Returns true iff T is a GIMPLE asm statement input.  */
935 extern bool is_gimple_asm_val (tree);
936 /* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a
937    GIMPLE temporary, a renamed user variable, or something else,
938    respectively.  */
939 extern bool is_gimple_reg_rhs (tree);
940 extern bool is_gimple_mem_rhs (tree);
941
942 /* Returns true iff T is a valid if-statement condition.  */
943 extern bool is_gimple_condexpr (tree);
944
945 /* Returns true iff T is a type conversion.  */
946 extern bool is_gimple_cast (tree);
947 /* Returns true iff T is a variable that does not need to live in memory.  */
948 extern bool is_gimple_non_addressable (tree t);
949
950 /* Returns true iff T is a valid call address expression.  */
951 extern bool is_gimple_call_addr (tree);
952 /* If T makes a function call, returns the CALL_EXPR operand.  */
953 extern tree get_call_expr_in (tree t);
954
955 extern void recalculate_side_effects (tree);
956 extern bool compare_field_offset (tree, tree);
957 extern tree gimple_register_type (tree);
958 extern void print_gimple_types_stats (void);
959 extern void free_gimple_type_tables (void);
960 extern tree gimple_unsigned_type (tree);
961 extern tree gimple_signed_type (tree);
962 extern alias_set_type gimple_get_alias_set (tree);
963 extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
964                                    unsigned *);
965 extern bool walk_stmt_load_store_addr_ops (gimple, void *,
966                                            bool (*)(gimple, tree, void *),
967                                            bool (*)(gimple, tree, void *),
968                                            bool (*)(gimple, tree, void *));
969 extern bool walk_stmt_load_store_ops (gimple, void *,
970                                       bool (*)(gimple, tree, void *),
971                                       bool (*)(gimple, tree, void *));
972 extern bool gimple_ior_addresses_taken (bitmap, gimple);
973
974 /* In gimplify.c  */
975 extern tree create_tmp_var_raw (tree, const char *);
976 extern tree create_tmp_var_name (const char *);
977 extern tree create_tmp_var (tree, const char *);
978 extern tree create_tmp_reg (tree, const char *);
979 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
980 extern tree get_formal_tmp_var (tree, gimple_seq *);
981 extern void declare_vars (tree, gimple, bool);
982 extern void annotate_all_with_location (gimple_seq, location_t);
983
984 /* Validation of GIMPLE expressions.  Note that these predicates only check
985    the basic form of the expression, they don't recurse to make sure that
986    underlying nodes are also of the right form.  */
987 typedef bool (*gimple_predicate)(tree);
988
989
990 /* FIXME we should deduce this from the predicate.  */
991 enum fallback {
992   fb_none = 0,          /* Do not generate a temporary.  */
993
994   fb_rvalue = 1,        /* Generate an rvalue to hold the result of a
995                            gimplified expression.  */
996
997   fb_lvalue = 2,        /* Generate an lvalue to hold the result of a
998                            gimplified expression.  */
999
1000   fb_mayfail = 4,       /* Gimplification may fail.  Error issued
1001                            afterwards.  */
1002   fb_either= fb_rvalue | fb_lvalue
1003 };
1004
1005 typedef int fallback_t;
1006
1007 enum gimplify_status {
1008   GS_ERROR      = -2,   /* Something Bad Seen.  */
1009   GS_UNHANDLED  = -1,   /* A langhook result for "I dunno".  */
1010   GS_OK         = 0,    /* We did something, maybe more to do.  */
1011   GS_ALL_DONE   = 1     /* The expression is fully gimplified.  */
1012 };
1013
1014 struct gimplify_ctx
1015 {
1016   struct gimplify_ctx *prev_context;
1017
1018   VEC(gimple,heap) *bind_expr_stack;
1019   tree temps;
1020   gimple_seq conditional_cleanups;
1021   tree exit_label;
1022   tree return_temp;
1023
1024   VEC(tree,heap) *case_labels;
1025   /* The formal temporary table.  Should this be persistent?  */
1026   htab_t temp_htab;
1027
1028   int conditions;
1029   bool save_stack;
1030   bool into_ssa;
1031   bool allow_rhs_cond_expr;
1032 };
1033
1034 extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
1035                                            bool (*) (tree), fallback_t);
1036 extern void gimplify_type_sizes (tree, gimple_seq *);
1037 extern void gimplify_one_sizepos (tree *, gimple_seq *);
1038 extern bool gimplify_stmt (tree *, gimple_seq *);
1039 extern gimple gimplify_body (tree *, tree, bool);
1040 extern void push_gimplify_context (struct gimplify_ctx *);
1041 extern void pop_gimplify_context (gimple);
1042 extern void gimplify_and_add (tree, gimple_seq *);
1043
1044 /* Miscellaneous helpers.  */
1045 extern void gimple_add_tmp_var (tree);
1046 extern gimple gimple_current_bind_expr (void);
1047 extern VEC(gimple, heap) *gimple_bind_expr_stack (void);
1048 extern tree voidify_wrapper_expr (tree, tree);
1049 extern tree build_and_jump (tree *);
1050 extern tree alloc_stmt_list (void);
1051 extern void free_stmt_list (tree);
1052 extern tree force_labels_r (tree *, int *, void *);
1053 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
1054                                                   gimple_seq *);
1055 struct gimplify_omp_ctx;
1056 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
1057 extern tree gimple_boolify (tree);
1058 extern gimple_predicate rhs_predicate_for (tree);
1059 extern tree canonicalize_cond_expr_cond (tree);
1060
1061 /* In omp-low.c.  */
1062 extern tree omp_reduction_init (tree, tree);
1063
1064 /* In tree-nested.c.  */
1065 extern void lower_nested_functions (tree);
1066 extern void insert_field_into_struct (tree, tree);
1067
1068 /* In gimplify.c.  */
1069 extern void gimplify_function_tree (tree);
1070
1071 /* In cfgexpand.c.  */
1072 extern tree gimple_assign_rhs_to_tree (gimple);
1073
1074 /* In builtins.c  */
1075 extern bool validate_gimple_arglist (const_gimple, ...);
1076
1077 /* In tree-ssa.c  */
1078 extern bool tree_ssa_useless_type_conversion (tree);
1079 extern tree tree_ssa_strip_useless_type_conversions (tree);
1080 extern bool useless_type_conversion_p (tree, tree);
1081 extern bool types_compatible_p (tree, tree);
1082
1083 /* Return the code for GIMPLE statement G.  */
1084
1085 static inline enum gimple_code
1086 gimple_code (const_gimple g)
1087 {
1088   return g->gsbase.code;
1089 }
1090
1091
1092 /* Return the GSS code used by a GIMPLE code.  */
1093
1094 static inline enum gimple_statement_structure_enum
1095 gss_for_code (enum gimple_code code)
1096 {
1097 #ifdef ENABLE_CHECKING
1098   gcc_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
1099 #endif
1100   return gss_for_code_[code];
1101 }
1102
1103
1104 /* Return which GSS code is used by GS.  */
1105
1106 static inline enum gimple_statement_structure_enum
1107 gimple_statement_structure (gimple gs)
1108 {
1109   return gss_for_code (gimple_code (gs));
1110 }
1111
1112
1113 /* Return true if statement G has sub-statements.  This is only true for
1114    High GIMPLE statements.  */
1115
1116 static inline bool
1117 gimple_has_substatements (gimple g)
1118 {
1119   switch (gimple_code (g))
1120     {
1121     case GIMPLE_BIND:
1122     case GIMPLE_CATCH:
1123     case GIMPLE_EH_FILTER:
1124     case GIMPLE_TRY:
1125     case GIMPLE_OMP_FOR:
1126     case GIMPLE_OMP_MASTER:
1127     case GIMPLE_OMP_ORDERED:
1128     case GIMPLE_OMP_SECTION:
1129     case GIMPLE_OMP_PARALLEL:
1130     case GIMPLE_OMP_TASK:
1131     case GIMPLE_OMP_SECTIONS:
1132     case GIMPLE_OMP_SINGLE:
1133     case GIMPLE_OMP_CRITICAL:
1134     case GIMPLE_WITH_CLEANUP_EXPR:
1135       return true;
1136
1137     default:
1138       return false;
1139     }
1140 }
1141
1142
1143 /* Return the basic block holding statement G.  */
1144
1145 static inline struct basic_block_def *
1146 gimple_bb (const_gimple g)
1147 {
1148   return g->gsbase.bb;
1149 }
1150
1151
1152 /* Return the lexical scope block holding statement G.  */
1153
1154 static inline tree
1155 gimple_block (const_gimple g)
1156 {
1157   return g->gsbase.block;
1158 }
1159
1160
1161 /* Set BLOCK to be the lexical scope block holding statement G.  */
1162
1163 static inline void
1164 gimple_set_block (gimple g, tree block)
1165 {
1166   g->gsbase.block = block;
1167 }
1168
1169
1170 /* Return location information for statement G.  */
1171
1172 static inline location_t
1173 gimple_location (const_gimple g)
1174 {
1175   return g->gsbase.location;
1176 }
1177
1178 /* Return pointer to location information for statement G.  */
1179
1180 static inline const location_t *
1181 gimple_location_ptr (const_gimple g)
1182 {
1183   return &g->gsbase.location;
1184 }
1185
1186
1187 /* Set location information for statement G.  */
1188
1189 static inline void
1190 gimple_set_location (gimple g, location_t location)
1191 {
1192   g->gsbase.location = location;
1193 }
1194
1195
1196 /* Return true if G contains location information.  */
1197
1198 static inline bool
1199 gimple_has_location (const_gimple g)
1200 {
1201   return gimple_location (g) != UNKNOWN_LOCATION;
1202 }
1203
1204
1205 /* Return the file name of the location of STMT.  */
1206
1207 static inline const char *
1208 gimple_filename (const_gimple stmt)
1209 {
1210   return LOCATION_FILE (gimple_location (stmt));
1211 }
1212
1213
1214 /* Return the line number of the location of STMT.  */
1215
1216 static inline int
1217 gimple_lineno (const_gimple stmt)
1218 {
1219   return LOCATION_LINE (gimple_location (stmt));
1220 }
1221
1222
1223 /* Determine whether SEQ is a singleton. */
1224
1225 static inline bool
1226 gimple_seq_singleton_p (gimple_seq seq)
1227 {
1228   return ((gimple_seq_first (seq) != NULL)
1229           && (gimple_seq_first (seq) == gimple_seq_last (seq)));
1230 }
1231
1232 /* Return true if no warnings should be emitted for statement STMT.  */
1233
1234 static inline bool
1235 gimple_no_warning_p (const_gimple stmt)
1236 {
1237   return stmt->gsbase.no_warning;
1238 }
1239
1240 /* Set the no_warning flag of STMT to NO_WARNING.  */
1241
1242 static inline void
1243 gimple_set_no_warning (gimple stmt, bool no_warning)
1244 {
1245   stmt->gsbase.no_warning = (unsigned) no_warning;
1246 }
1247
1248 /* Set the visited status on statement STMT to VISITED_P.  */
1249
1250 static inline void
1251 gimple_set_visited (gimple stmt, bool visited_p)
1252 {
1253   stmt->gsbase.visited = (unsigned) visited_p;
1254 }
1255
1256
1257 /* Return the visited status for statement STMT.  */
1258
1259 static inline bool
1260 gimple_visited_p (gimple stmt)
1261 {
1262   return stmt->gsbase.visited;
1263 }
1264
1265
1266 /* Set pass local flag PLF on statement STMT to VAL_P.  */
1267
1268 static inline void
1269 gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
1270 {
1271   if (val_p)
1272     stmt->gsbase.plf |= (unsigned int) plf;
1273   else
1274     stmt->gsbase.plf &= ~((unsigned int) plf);
1275 }
1276
1277
1278 /* Return the value of pass local flag PLF on statement STMT.  */
1279
1280 static inline unsigned int
1281 gimple_plf (gimple stmt, enum plf_mask plf)
1282 {
1283   return stmt->gsbase.plf & ((unsigned int) plf);
1284 }
1285
1286
1287 /* Set the UID of statement.  */
1288
1289 static inline void
1290 gimple_set_uid (gimple g, unsigned uid)
1291 {
1292   g->gsbase.uid = uid;
1293 }
1294
1295
1296 /* Return the UID of statement.  */
1297
1298 static inline unsigned
1299 gimple_uid (const_gimple g)
1300 {
1301   return g->gsbase.uid;
1302 }
1303
1304
1305 /* Return true if GIMPLE statement G has register or memory operands.  */
1306
1307 static inline bool
1308 gimple_has_ops (const_gimple g)
1309 {
1310   return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
1311 }
1312
1313
1314 /* Return true if GIMPLE statement G has memory operands.  */
1315
1316 static inline bool
1317 gimple_has_mem_ops (const_gimple g)
1318 {
1319   return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
1320 }
1321
1322
1323 /* Return the set of DEF operands for statement G.  */
1324
1325 static inline struct def_optype_d *
1326 gimple_def_ops (const_gimple g)
1327 {
1328   if (!gimple_has_ops (g))
1329     return NULL;
1330   return g->gsops.opbase.def_ops;
1331 }
1332
1333
1334 /* Set DEF to be the set of DEF operands for statement G.  */
1335
1336 static inline void
1337 gimple_set_def_ops (gimple g, struct def_optype_d *def)
1338 {
1339   gcc_assert (gimple_has_ops (g));
1340   g->gsops.opbase.def_ops = def;
1341 }
1342
1343
1344 /* Return the set of USE operands for statement G.  */
1345
1346 static inline struct use_optype_d *
1347 gimple_use_ops (const_gimple g)
1348 {
1349   if (!gimple_has_ops (g))
1350     return NULL;
1351   return g->gsops.opbase.use_ops;
1352 }
1353
1354
1355 /* Set USE to be the set of USE operands for statement G.  */
1356
1357 static inline void
1358 gimple_set_use_ops (gimple g, struct use_optype_d *use)
1359 {
1360   gcc_assert (gimple_has_ops (g));
1361   g->gsops.opbase.use_ops = use;
1362 }
1363
1364
1365 /* Return the set of VUSE operand for statement G.  */
1366
1367 static inline use_operand_p
1368 gimple_vuse_op (const_gimple g)
1369 {
1370   struct use_optype_d *ops;
1371   if (!gimple_has_mem_ops (g))
1372     return NULL_USE_OPERAND_P;
1373   ops = g->gsops.opbase.use_ops;
1374   if (ops
1375       && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
1376     return USE_OP_PTR (ops);
1377   return NULL_USE_OPERAND_P;
1378 }
1379
1380 /* Return the set of VDEF operand for statement G.  */
1381
1382 static inline def_operand_p
1383 gimple_vdef_op (const_gimple g)
1384 {
1385   struct def_optype_d *ops;
1386   if (!gimple_has_mem_ops (g))
1387     return NULL_DEF_OPERAND_P;
1388   ops = g->gsops.opbase.def_ops;
1389   if (ops
1390       && DEF_OP_PTR (ops) == &g->gsmembase.vdef)
1391     return DEF_OP_PTR (ops);
1392   return NULL_DEF_OPERAND_P;
1393 }
1394
1395
1396 /* Return the single VUSE operand of the statement G.  */
1397
1398 static inline tree
1399 gimple_vuse (const_gimple g)
1400 {
1401   if (!gimple_has_mem_ops (g))
1402     return NULL_TREE;
1403   return g->gsmembase.vuse;
1404 }
1405
1406 /* Return the single VDEF operand of the statement G.  */
1407
1408 static inline tree
1409 gimple_vdef (const_gimple g)
1410 {
1411   if (!gimple_has_mem_ops (g))
1412     return NULL_TREE;
1413   return g->gsmembase.vdef;
1414 }
1415
1416 /* Return the single VUSE operand of the statement G.  */
1417
1418 static inline tree *
1419 gimple_vuse_ptr (gimple g)
1420 {
1421   if (!gimple_has_mem_ops (g))
1422     return NULL;
1423   return &g->gsmembase.vuse;
1424 }
1425
1426 /* Return the single VDEF operand of the statement G.  */
1427
1428 static inline tree *
1429 gimple_vdef_ptr (gimple g)
1430 {
1431   if (!gimple_has_mem_ops (g))
1432     return NULL;
1433   return &g->gsmembase.vdef;
1434 }
1435
1436 /* Set the single VUSE operand of the statement G.  */
1437
1438 static inline void
1439 gimple_set_vuse (gimple g, tree vuse)
1440 {
1441   gcc_assert (gimple_has_mem_ops (g));
1442   g->gsmembase.vuse = vuse;
1443 }
1444
1445 /* Set the single VDEF operand of the statement G.  */
1446
1447 static inline void
1448 gimple_set_vdef (gimple g, tree vdef)
1449 {
1450   gcc_assert (gimple_has_mem_ops (g));
1451   g->gsmembase.vdef = vdef;
1452 }
1453
1454
1455 /* Return true if statement G has operands and the modified field has
1456    been set.  */
1457
1458 static inline bool
1459 gimple_modified_p (const_gimple g)
1460 {
1461   return (gimple_has_ops (g)) ? (bool) g->gsbase.modified : false;
1462 }
1463
1464
1465 /* Return the tree code for the expression computed by STMT.  This is
1466    only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN.  For
1467    GIMPLE_CALL, return CALL_EXPR as the expression code for
1468    consistency.  This is useful when the caller needs to deal with the
1469    three kinds of computation that GIMPLE supports.  */
1470
1471 static inline enum tree_code
1472 gimple_expr_code (const_gimple stmt)
1473 {
1474   enum gimple_code code = gimple_code (stmt);
1475   if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
1476     return (enum tree_code) stmt->gsbase.subcode;
1477   else if (code == GIMPLE_CALL)
1478     return CALL_EXPR;
1479   else
1480     gcc_unreachable ();
1481 }
1482
1483
1484 /* Mark statement S as modified, and update it.  */
1485
1486 static inline void
1487 update_stmt (gimple s)
1488 {
1489   if (gimple_has_ops (s))
1490     {
1491       gimple_set_modified (s, true);
1492       update_stmt_operands (s);
1493     }
1494 }
1495
1496 /* Update statement S if it has been optimized.  */
1497
1498 static inline void
1499 update_stmt_if_modified (gimple s)
1500 {
1501   if (gimple_modified_p (s))
1502     update_stmt_operands (s);
1503 }
1504
1505 /* Return true if statement STMT contains volatile operands.  */
1506
1507 static inline bool
1508 gimple_has_volatile_ops (const_gimple stmt)
1509 {
1510   if (gimple_has_mem_ops (stmt))
1511     return stmt->gsbase.has_volatile_ops;
1512   else
1513     return false;
1514 }
1515
1516
1517 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP.  */
1518
1519 static inline void
1520 gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
1521 {
1522   if (gimple_has_mem_ops (stmt))
1523     stmt->gsbase.has_volatile_ops = (unsigned) volatilep;
1524 }
1525
1526
1527 /* Return true if statement STMT may access memory.  */
1528
1529 static inline bool
1530 gimple_references_memory_p (gimple stmt)
1531 {
1532   return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
1533 }
1534
1535
1536 /* Return the subcode for OMP statement S.  */
1537
1538 static inline unsigned
1539 gimple_omp_subcode (const_gimple s)
1540 {
1541   gcc_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
1542               && gimple_code (s) <= GIMPLE_OMP_SINGLE);
1543   return s->gsbase.subcode;
1544 }
1545
1546 /* Set the subcode for OMP statement S to SUBCODE.  */
1547
1548 static inline void
1549 gimple_omp_set_subcode (gimple s, unsigned int subcode)
1550 {
1551   /* We only have 16 bits for the subcode.  Assert that we are not
1552      overflowing it.  */
1553   gcc_assert (subcode < (1 << 16));
1554   s->gsbase.subcode = subcode;
1555 }
1556
1557 /* Set the nowait flag on OMP_RETURN statement S.  */
1558
1559 static inline void
1560 gimple_omp_return_set_nowait (gimple s)
1561 {
1562   GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
1563   s->gsbase.subcode |= GF_OMP_RETURN_NOWAIT;
1564 }
1565
1566
1567 /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
1568    flag set.  */
1569
1570 static inline bool
1571 gimple_omp_return_nowait_p (const_gimple g)
1572 {
1573   GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
1574   return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
1575 }
1576
1577
1578 /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
1579    flag set.  */
1580
1581 static inline bool
1582 gimple_omp_section_last_p (const_gimple g)
1583 {
1584   GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1585   return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
1586 }
1587
1588
1589 /* Set the GF_OMP_SECTION_LAST flag on G.  */
1590
1591 static inline void
1592 gimple_omp_section_set_last (gimple g)
1593 {
1594   GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
1595   g->gsbase.subcode |= GF_OMP_SECTION_LAST;
1596 }
1597
1598
1599 /* Return true if OMP parallel statement G has the
1600    GF_OMP_PARALLEL_COMBINED flag set.  */
1601
1602 static inline bool
1603 gimple_omp_parallel_combined_p (const_gimple g)
1604 {
1605   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1606   return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
1607 }
1608
1609
1610 /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
1611    value of COMBINED_P.  */
1612
1613 static inline void
1614 gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
1615 {
1616   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
1617   if (combined_p)
1618     g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
1619   else
1620     g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
1621 }
1622
1623
1624 /* Return the number of operands for statement GS.  */
1625
1626 static inline unsigned
1627 gimple_num_ops (const_gimple gs)
1628 {
1629   return gs->gsbase.num_ops;
1630 }
1631
1632
1633 /* Set the number of operands for statement GS.  */
1634
1635 static inline void
1636 gimple_set_num_ops (gimple gs, unsigned num_ops)
1637 {
1638   gs->gsbase.num_ops = num_ops;
1639 }
1640
1641
1642 /* Return the array of operands for statement GS.  */
1643
1644 static inline tree *
1645 gimple_ops (gimple gs)
1646 {
1647   size_t off;
1648
1649   /* All the tuples have their operand vector at the very bottom
1650      of the structure.  Note that those structures that do not
1651      have an operand vector have a zero offset.  */
1652   off = gimple_ops_offset_[gimple_statement_structure (gs)];
1653   gcc_assert (off != 0);
1654
1655   return (tree *) ((char *) gs + off);
1656 }
1657
1658
1659 /* Return operand I for statement GS.  */
1660
1661 static inline tree
1662 gimple_op (const_gimple gs, unsigned i)
1663 {
1664   if (gimple_has_ops (gs))
1665     {
1666 #ifdef ENABLE_CHECKING
1667       gcc_assert (i < gimple_num_ops (gs));
1668 #endif
1669       return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
1670     }
1671   else
1672     return NULL_TREE;
1673 }
1674
1675 /* Return a pointer to operand I for statement GS.  */
1676
1677 static inline tree *
1678 gimple_op_ptr (const_gimple gs, unsigned i)
1679 {
1680   if (gimple_has_ops (gs))
1681     {
1682 #ifdef ENABLE_CHECKING
1683       gcc_assert (i < gimple_num_ops (gs));
1684 #endif
1685       return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
1686     }
1687   else
1688     return NULL;
1689 }
1690
1691 /* Set operand I of statement GS to OP.  */
1692
1693 static inline void
1694 gimple_set_op (gimple gs, unsigned i, tree op)
1695 {
1696   gcc_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
1697
1698   /* Note.  It may be tempting to assert that OP matches
1699      is_gimple_operand, but that would be wrong.  Different tuples
1700      accept slightly different sets of tree operands.  Each caller
1701      should perform its own validation.  */
1702   gimple_ops (gs)[i] = op;
1703 }
1704
1705 /* Return true if GS is a GIMPLE_ASSIGN.  */
1706
1707 static inline bool
1708 is_gimple_assign (const_gimple gs)
1709 {
1710   return gimple_code (gs) == GIMPLE_ASSIGN;
1711 }
1712
1713 /* Determine if expression CODE is one of the valid expressions that can
1714    be used on the RHS of GIMPLE assignments.  */
1715
1716 static inline enum gimple_rhs_class
1717 get_gimple_rhs_class (enum tree_code code)
1718 {
1719   return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
1720 }
1721
1722 /* Return the LHS of assignment statement GS.  */
1723
1724 static inline tree
1725 gimple_assign_lhs (const_gimple gs)
1726 {
1727   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1728   return gimple_op (gs, 0);
1729 }
1730
1731
1732 /* Return a pointer to the LHS of assignment statement GS.  */
1733
1734 static inline tree *
1735 gimple_assign_lhs_ptr (const_gimple gs)
1736 {
1737   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1738   return gimple_op_ptr (gs, 0);
1739 }
1740
1741
1742 /* Set LHS to be the LHS operand of assignment statement GS.  */
1743
1744 static inline void
1745 gimple_assign_set_lhs (gimple gs, tree lhs)
1746 {
1747   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1748   gimple_set_op (gs, 0, lhs);
1749
1750   if (lhs && TREE_CODE (lhs) == SSA_NAME)
1751     SSA_NAME_DEF_STMT (lhs) = gs;
1752 }
1753
1754
1755 /* Return the first operand on the RHS of assignment statement GS.  */
1756
1757 static inline tree
1758 gimple_assign_rhs1 (const_gimple gs)
1759 {
1760   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1761   return gimple_op (gs, 1);
1762 }
1763
1764
1765 /* Return a pointer to the first operand on the RHS of assignment
1766    statement GS.  */
1767
1768 static inline tree *
1769 gimple_assign_rhs1_ptr (const_gimple gs)
1770 {
1771   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1772   return gimple_op_ptr (gs, 1);
1773 }
1774
1775 /* Set RHS to be the first operand on the RHS of assignment statement GS.  */
1776
1777 static inline void
1778 gimple_assign_set_rhs1 (gimple gs, tree rhs)
1779 {
1780   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1781
1782   gimple_set_op (gs, 1, rhs);
1783 }
1784
1785
1786 /* Return the second operand on the RHS of assignment statement GS.
1787    If GS does not have two operands, NULL is returned instead.  */
1788
1789 static inline tree
1790 gimple_assign_rhs2 (const_gimple gs)
1791 {
1792   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1793
1794   if (gimple_num_ops (gs) >= 3)
1795     return gimple_op (gs, 2);
1796   else
1797     return NULL_TREE;
1798 }
1799
1800
1801 /* Return a pointer to the second operand on the RHS of assignment
1802    statement GS.  */
1803
1804 static inline tree *
1805 gimple_assign_rhs2_ptr (const_gimple gs)
1806 {
1807   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1808   return gimple_op_ptr (gs, 2);
1809 }
1810
1811
1812 /* Set RHS to be the second operand on the RHS of assignment statement GS.  */
1813
1814 static inline void
1815 gimple_assign_set_rhs2 (gimple gs, tree rhs)
1816 {
1817   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1818
1819   gimple_set_op (gs, 2, rhs);
1820 }
1821
1822 /* Returns true if GS is a nontemporal move.  */
1823
1824 static inline bool
1825 gimple_assign_nontemporal_move_p (const_gimple gs)
1826 {
1827   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1828   return gs->gsbase.nontemporal_move;
1829 }
1830
1831 /* Sets nontemporal move flag of GS to NONTEMPORAL.  */
1832
1833 static inline void
1834 gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
1835 {
1836   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1837   gs->gsbase.nontemporal_move = nontemporal;
1838 }
1839
1840
1841 /* Return the code of the expression computed on the rhs of assignment
1842    statement GS.  In case that the RHS is a single object, returns the
1843    tree code of the object.  */
1844
1845 static inline enum tree_code
1846 gimple_assign_rhs_code (const_gimple gs)
1847 {
1848   enum tree_code code;
1849   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
1850
1851   code = gimple_expr_code (gs);
1852   if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
1853     code = TREE_CODE (gimple_assign_rhs1 (gs));
1854
1855   return code;
1856 }
1857
1858
1859 /* Set CODE to be the code for the expression computed on the RHS of
1860    assignment S.  */
1861
1862 static inline void
1863 gimple_assign_set_rhs_code (gimple s, enum tree_code code)
1864 {
1865   GIMPLE_CHECK (s, GIMPLE_ASSIGN);
1866   s->gsbase.subcode = code;
1867 }
1868
1869
1870 /* Return the gimple rhs class of the code of the expression computed on
1871    the rhs of assignment statement GS.
1872    This will never return GIMPLE_INVALID_RHS.  */
1873
1874 static inline enum gimple_rhs_class
1875 gimple_assign_rhs_class (const_gimple gs)
1876 {
1877   return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
1878 }
1879
1880
1881 /* Return true if S is a type-cast assignment.  */
1882
1883 static inline bool
1884 gimple_assign_cast_p (gimple s)
1885 {
1886   if (is_gimple_assign (s))
1887     {
1888       enum tree_code sc = gimple_assign_rhs_code (s);
1889       return CONVERT_EXPR_CODE_P (sc)
1890              || sc == VIEW_CONVERT_EXPR
1891              || sc == FIX_TRUNC_EXPR;
1892     }
1893
1894   return false;
1895 }
1896
1897
1898 /* Return true if GS is a GIMPLE_CALL.  */
1899
1900 static inline bool
1901 is_gimple_call (const_gimple gs)
1902 {
1903   return gimple_code (gs) == GIMPLE_CALL;
1904 }
1905
1906 /* Return the LHS of call statement GS.  */
1907
1908 static inline tree
1909 gimple_call_lhs (const_gimple gs)
1910 {
1911   GIMPLE_CHECK (gs, GIMPLE_CALL);
1912   return gimple_op (gs, 0);
1913 }
1914
1915
1916 /* Return a pointer to the LHS of call statement GS.  */
1917
1918 static inline tree *
1919 gimple_call_lhs_ptr (const_gimple gs)
1920 {
1921   GIMPLE_CHECK (gs, GIMPLE_CALL);
1922   return gimple_op_ptr (gs, 0);
1923 }
1924
1925
1926 /* Set LHS to be the LHS operand of call statement GS.  */
1927
1928 static inline void
1929 gimple_call_set_lhs (gimple gs, tree lhs)
1930 {
1931   GIMPLE_CHECK (gs, GIMPLE_CALL);
1932   gimple_set_op (gs, 0, lhs);
1933   if (lhs && TREE_CODE (lhs) == SSA_NAME)
1934     SSA_NAME_DEF_STMT (lhs) = gs;
1935 }
1936
1937
1938 /* Return the tree node representing the function called by call
1939    statement GS.  */
1940
1941 static inline tree
1942 gimple_call_fn (const_gimple gs)
1943 {
1944   GIMPLE_CHECK (gs, GIMPLE_CALL);
1945   return gimple_op (gs, 1);
1946 }
1947
1948
1949 /* Return a pointer to the tree node representing the function called by call
1950    statement GS.  */
1951
1952 static inline tree *
1953 gimple_call_fn_ptr (const_gimple gs)
1954 {
1955   GIMPLE_CHECK (gs, GIMPLE_CALL);
1956   return gimple_op_ptr (gs, 1);
1957 }
1958
1959
1960 /* Set FN to be the function called by call statement GS.  */
1961
1962 static inline void
1963 gimple_call_set_fn (gimple gs, tree fn)
1964 {
1965   GIMPLE_CHECK (gs, GIMPLE_CALL);
1966   gimple_set_op (gs, 1, fn);
1967 }
1968
1969
1970 /* Set FNDECL to be the function called by call statement GS.  */
1971
1972 static inline void
1973 gimple_call_set_fndecl (gimple gs, tree decl)
1974 {
1975   GIMPLE_CHECK (gs, GIMPLE_CALL);
1976   gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
1977 }
1978
1979
1980 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
1981    Otherwise return NULL.  This function is analogous to
1982    get_callee_fndecl in tree land.  */
1983
1984 static inline tree
1985 gimple_call_fndecl (const_gimple gs)
1986 {
1987   tree addr = gimple_call_fn (gs);
1988   if (TREE_CODE (addr) == ADDR_EXPR)
1989     return TREE_OPERAND (addr, 0);
1990   return NULL_TREE;
1991 }
1992
1993
1994 /* Return the type returned by call statement GS.  */
1995
1996 static inline tree
1997 gimple_call_return_type (const_gimple gs)
1998 {
1999   tree fn = gimple_call_fn (gs);
2000   tree type = TREE_TYPE (fn);
2001
2002   /* See through the pointer.  */
2003   type = TREE_TYPE (type);
2004
2005   /* The type returned by a FUNCTION_DECL is the type of its
2006      function type.  */
2007   return TREE_TYPE (type);
2008 }
2009
2010
2011 /* Return the static chain for call statement GS.  */
2012
2013 static inline tree
2014 gimple_call_chain (const_gimple gs)
2015 {
2016   GIMPLE_CHECK (gs, GIMPLE_CALL);
2017   return gimple_op (gs, 2);
2018 }
2019
2020
2021 /* Return a pointer to the static chain for call statement GS.  */
2022
2023 static inline tree *
2024 gimple_call_chain_ptr (const_gimple gs)
2025 {
2026   GIMPLE_CHECK (gs, GIMPLE_CALL);
2027   return gimple_op_ptr (gs, 2);
2028 }
2029
2030 /* Set CHAIN to be the static chain for call statement GS.  */
2031
2032 static inline void
2033 gimple_call_set_chain (gimple gs, tree chain)
2034 {
2035   GIMPLE_CHECK (gs, GIMPLE_CALL);
2036
2037   gimple_set_op (gs, 2, chain);
2038 }
2039
2040
2041 /* Return the number of arguments used by call statement GS.  */
2042
2043 static inline unsigned
2044 gimple_call_num_args (const_gimple gs)
2045 {
2046   unsigned num_ops;
2047   GIMPLE_CHECK (gs, GIMPLE_CALL);
2048   num_ops = gimple_num_ops (gs);
2049   return num_ops - 3;
2050 }
2051
2052
2053 /* Return the argument at position INDEX for call statement GS.  */
2054
2055 static inline tree
2056 gimple_call_arg (const_gimple gs, unsigned index)
2057 {
2058   GIMPLE_CHECK (gs, GIMPLE_CALL);
2059   return gimple_op (gs, index + 3);
2060 }
2061
2062
2063 /* Return a pointer to the argument at position INDEX for call
2064    statement GS.  */
2065
2066 static inline tree *
2067 gimple_call_arg_ptr (const_gimple gs, unsigned index)
2068 {
2069   GIMPLE_CHECK (gs, GIMPLE_CALL);
2070   return gimple_op_ptr (gs, index + 3);
2071 }
2072
2073
2074 /* Set ARG to be the argument at position INDEX for call statement GS.  */
2075
2076 static inline void
2077 gimple_call_set_arg (gimple gs, unsigned index, tree arg)
2078 {
2079   GIMPLE_CHECK (gs, GIMPLE_CALL);
2080   gimple_set_op (gs, index + 3, arg);
2081 }
2082
2083
2084 /* If TAIL_P is true, mark call statement S as being a tail call
2085    (i.e., a call just before the exit of a function).  These calls are
2086    candidate for tail call optimization.  */
2087
2088 static inline void
2089 gimple_call_set_tail (gimple s, bool tail_p)
2090 {
2091   GIMPLE_CHECK (s, GIMPLE_CALL);
2092   if (tail_p)
2093     s->gsbase.subcode |= GF_CALL_TAILCALL;
2094   else
2095     s->gsbase.subcode &= ~GF_CALL_TAILCALL;
2096 }
2097
2098
2099 /* Return true if GIMPLE_CALL S is marked as a tail call.  */
2100
2101 static inline bool
2102 gimple_call_tail_p (gimple s)
2103 {
2104   GIMPLE_CHECK (s, GIMPLE_CALL);
2105   return (s->gsbase.subcode & GF_CALL_TAILCALL) != 0;
2106 }
2107
2108
2109 /* Set the inlinable status of GIMPLE_CALL S to INLINABLE_P.  */
2110
2111 static inline void
2112 gimple_call_set_cannot_inline (gimple s, bool inlinable_p)
2113 {
2114   GIMPLE_CHECK (s, GIMPLE_CALL);
2115   if (inlinable_p)
2116     s->gsbase.subcode |= GF_CALL_CANNOT_INLINE;
2117   else
2118     s->gsbase.subcode &= ~GF_CALL_CANNOT_INLINE;
2119 }
2120
2121
2122 /* Return true if GIMPLE_CALL S cannot be inlined.  */
2123
2124 static inline bool
2125 gimple_call_cannot_inline_p (gimple s)
2126 {
2127   GIMPLE_CHECK (s, GIMPLE_CALL);
2128   return (s->gsbase.subcode & GF_CALL_CANNOT_INLINE) != 0;
2129 }
2130
2131
2132 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
2133    slot optimization.  This transformation uses the target of the call
2134    expansion as the return slot for calls that return in memory.  */
2135
2136 static inline void
2137 gimple_call_set_return_slot_opt (gimple s, bool return_slot_opt_p)
2138 {
2139   GIMPLE_CHECK (s, GIMPLE_CALL);
2140   if (return_slot_opt_p)
2141     s->gsbase.subcode |= GF_CALL_RETURN_SLOT_OPT;
2142   else
2143     s->gsbase.subcode &= ~GF_CALL_RETURN_SLOT_OPT;
2144 }
2145
2146
2147 /* Return true if S is marked for return slot optimization.  */
2148
2149 static inline bool
2150 gimple_call_return_slot_opt_p (gimple s)
2151 {
2152   GIMPLE_CHECK (s, GIMPLE_CALL);
2153   return (s->gsbase.subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
2154 }
2155
2156
2157 /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
2158    thunk to the thunked-to function.  */
2159
2160 static inline void
2161 gimple_call_set_from_thunk (gimple s, bool from_thunk_p)
2162 {
2163   GIMPLE_CHECK (s, GIMPLE_CALL);
2164   if (from_thunk_p)
2165     s->gsbase.subcode |= GF_CALL_FROM_THUNK;
2166   else
2167     s->gsbase.subcode &= ~GF_CALL_FROM_THUNK;
2168 }
2169
2170
2171 /* Return true if GIMPLE_CALL S is a jump from a thunk.  */
2172
2173 static inline bool
2174 gimple_call_from_thunk_p (gimple s)
2175 {
2176   GIMPLE_CHECK (s, GIMPLE_CALL);
2177   return (s->gsbase.subcode & GF_CALL_FROM_THUNK) != 0;
2178 }
2179
2180
2181 /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
2182    argument pack in its argument list.  */
2183
2184 static inline void
2185 gimple_call_set_va_arg_pack (gimple s, bool pass_arg_pack_p)
2186 {
2187   GIMPLE_CHECK (s, GIMPLE_CALL);
2188   if (pass_arg_pack_p)
2189     s->gsbase.subcode |= GF_CALL_VA_ARG_PACK;
2190   else
2191     s->gsbase.subcode &= ~GF_CALL_VA_ARG_PACK;
2192 }
2193
2194
2195 /* Return true if GIMPLE_CALL S is a stdarg call that needs the
2196    argument pack in its argument list.  */
2197
2198 static inline bool
2199 gimple_call_va_arg_pack_p (gimple s)
2200 {
2201   GIMPLE_CHECK (s, GIMPLE_CALL);
2202   return (s->gsbase.subcode & GF_CALL_VA_ARG_PACK) != 0;
2203 }
2204
2205
2206 /* Return true if S is a noreturn call.  */
2207
2208 static inline bool
2209 gimple_call_noreturn_p (gimple s)
2210 {
2211   GIMPLE_CHECK (s, GIMPLE_CALL);
2212   return (gimple_call_flags (s) & ECF_NORETURN) != 0;
2213 }
2214
2215
2216 /* Return true if S is a nothrow call.  */
2217
2218 static inline bool
2219 gimple_call_nothrow_p (gimple s)
2220 {
2221   GIMPLE_CHECK (s, GIMPLE_CALL);
2222   return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
2223 }
2224
2225
2226 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL.  */
2227
2228 static inline void
2229 gimple_call_copy_flags (gimple dest_call, gimple orig_call)
2230 {
2231   GIMPLE_CHECK (dest_call, GIMPLE_CALL);
2232   GIMPLE_CHECK (orig_call, GIMPLE_CALL);
2233   dest_call->gsbase.subcode = orig_call->gsbase.subcode;
2234 }
2235
2236
2237 /* Return a pointer to the points-to solution for the set of call-used
2238    variables of the call CALL.  */
2239
2240 static inline struct pt_solution *
2241 gimple_call_use_set (gimple call)
2242 {
2243   GIMPLE_CHECK (call, GIMPLE_CALL);
2244   return &call->gimple_call.call_used;
2245 }
2246
2247
2248 /* Return a pointer to the points-to solution for the set of call-used
2249    variables of the call CALL.  */
2250
2251 static inline struct pt_solution *
2252 gimple_call_clobber_set (gimple call)
2253 {
2254   GIMPLE_CHECK (call, GIMPLE_CALL);
2255   return &call->gimple_call.call_clobbered;
2256 }
2257
2258
2259 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
2260    non-NULL lhs.  */
2261
2262 static inline bool
2263 gimple_has_lhs (gimple stmt)
2264 {
2265   return (is_gimple_assign (stmt)
2266           || (is_gimple_call (stmt)
2267               && gimple_call_lhs (stmt) != NULL_TREE));
2268 }
2269
2270
2271 /* Return the code of the predicate computed by conditional statement GS.  */
2272
2273 static inline enum tree_code
2274 gimple_cond_code (const_gimple gs)
2275 {
2276   GIMPLE_CHECK (gs, GIMPLE_COND);
2277   return (enum tree_code) gs->gsbase.subcode;
2278 }
2279
2280
2281 /* Set CODE to be the predicate code for the conditional statement GS.  */
2282
2283 static inline void
2284 gimple_cond_set_code (gimple gs, enum tree_code code)
2285 {
2286   GIMPLE_CHECK (gs, GIMPLE_COND);
2287   gs->gsbase.subcode = code;
2288 }
2289
2290
2291 /* Return the LHS of the predicate computed by conditional statement GS.  */
2292
2293 static inline tree
2294 gimple_cond_lhs (const_gimple gs)
2295 {
2296   GIMPLE_CHECK (gs, GIMPLE_COND);
2297   return gimple_op (gs, 0);
2298 }
2299
2300 /* Return the pointer to the LHS of the predicate computed by conditional
2301    statement GS.  */
2302
2303 static inline tree *
2304 gimple_cond_lhs_ptr (const_gimple gs)
2305 {
2306   GIMPLE_CHECK (gs, GIMPLE_COND);
2307   return gimple_op_ptr (gs, 0);
2308 }
2309
2310 /* Set LHS to be the LHS operand of the predicate computed by
2311    conditional statement GS.  */
2312
2313 static inline void
2314 gimple_cond_set_lhs (gimple gs, tree lhs)
2315 {
2316   GIMPLE_CHECK (gs, GIMPLE_COND);
2317   gimple_set_op (gs, 0, lhs);
2318 }
2319
2320
2321 /* Return the RHS operand of the predicate computed by conditional GS.  */
2322
2323 static inline tree
2324 gimple_cond_rhs (const_gimple gs)
2325 {
2326   GIMPLE_CHECK (gs, GIMPLE_COND);
2327   return gimple_op (gs, 1);
2328 }
2329
2330 /* Return the pointer to the RHS operand of the predicate computed by
2331    conditional GS.  */
2332
2333 static inline tree *
2334 gimple_cond_rhs_ptr (const_gimple gs)
2335 {
2336   GIMPLE_CHECK (gs, GIMPLE_COND);
2337   return gimple_op_ptr (gs, 1);
2338 }
2339
2340
2341 /* Set RHS to be the RHS operand of the predicate computed by
2342    conditional statement GS.  */
2343
2344 static inline void
2345 gimple_cond_set_rhs (gimple gs, tree rhs)
2346 {
2347   GIMPLE_CHECK (gs, GIMPLE_COND);
2348   gimple_set_op (gs, 1, rhs);
2349 }
2350
2351
2352 /* Return the label used by conditional statement GS when its
2353    predicate evaluates to true.  */
2354
2355 static inline tree
2356 gimple_cond_true_label (const_gimple gs)
2357 {
2358   GIMPLE_CHECK (gs, GIMPLE_COND);
2359   return gimple_op (gs, 2);
2360 }
2361
2362
2363 /* Set LABEL to be the label used by conditional statement GS when its
2364    predicate evaluates to true.  */
2365
2366 static inline void
2367 gimple_cond_set_true_label (gimple gs, tree label)
2368 {
2369   GIMPLE_CHECK (gs, GIMPLE_COND);
2370   gimple_set_op (gs, 2, label);
2371 }
2372
2373
2374 /* Set LABEL to be the label used by conditional statement GS when its
2375    predicate evaluates to false.  */
2376
2377 static inline void
2378 gimple_cond_set_false_label (gimple gs, tree label)
2379 {
2380   GIMPLE_CHECK (gs, GIMPLE_COND);
2381   gimple_set_op (gs, 3, label);
2382 }
2383
2384
2385 /* Return the label used by conditional statement GS when its
2386    predicate evaluates to false.  */
2387
2388 static inline tree
2389 gimple_cond_false_label (const_gimple gs)
2390 {
2391   GIMPLE_CHECK (gs, GIMPLE_COND);
2392   return gimple_op (gs, 3);
2393 }
2394
2395
2396 /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'.  */
2397
2398 static inline void
2399 gimple_cond_make_false (gimple gs)
2400 {
2401   gimple_cond_set_lhs (gs, boolean_true_node);
2402   gimple_cond_set_rhs (gs, boolean_false_node);
2403   gs->gsbase.subcode = EQ_EXPR;
2404 }
2405
2406
2407 /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'.  */
2408
2409 static inline void
2410 gimple_cond_make_true (gimple gs)
2411 {
2412   gimple_cond_set_lhs (gs, boolean_true_node);
2413   gimple_cond_set_rhs (gs, boolean_true_node);
2414   gs->gsbase.subcode = EQ_EXPR;
2415 }
2416
2417 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
2418   'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
2419
2420 static inline bool
2421 gimple_cond_true_p (const_gimple gs)
2422 {
2423   tree lhs = gimple_cond_lhs (gs);
2424   tree rhs = gimple_cond_rhs (gs);
2425   enum tree_code code = gimple_cond_code (gs);
2426
2427   if (lhs != boolean_true_node && lhs != boolean_false_node)
2428     return false;
2429
2430   if (rhs != boolean_true_node && rhs != boolean_false_node)
2431     return false;
2432
2433   if (code == NE_EXPR && lhs != rhs)
2434     return true;
2435
2436   if (code == EQ_EXPR && lhs == rhs)
2437       return true;
2438
2439   return false;
2440 }
2441
2442 /* Check if conditional statement GS is of the form 'if (1 != 1)',
2443    'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
2444
2445 static inline bool
2446 gimple_cond_false_p (const_gimple gs)
2447 {
2448   tree lhs = gimple_cond_lhs (gs);
2449   tree rhs = gimple_cond_rhs (gs);
2450   enum tree_code code = gimple_cond_code (gs);
2451
2452   if (lhs != boolean_true_node && lhs != boolean_false_node)
2453     return false;
2454
2455   if (rhs != boolean_true_node && rhs != boolean_false_node)
2456     return false;
2457
2458   if (code == NE_EXPR && lhs == rhs)
2459     return true;
2460
2461   if (code == EQ_EXPR && lhs != rhs)
2462       return true;
2463
2464   return false;
2465 }
2466
2467 /* Check if conditional statement GS is of the form 'if (var != 0)' or
2468    'if (var == 1)' */
2469
2470 static inline bool
2471 gimple_cond_single_var_p (gimple gs)
2472 {
2473   if (gimple_cond_code (gs) == NE_EXPR
2474       && gimple_cond_rhs (gs) == boolean_false_node)
2475     return true;
2476
2477   if (gimple_cond_code (gs) == EQ_EXPR
2478       && gimple_cond_rhs (gs) == boolean_true_node)
2479     return true;
2480
2481   return false;
2482 }
2483
2484 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS.  */
2485
2486 static inline void
2487 gimple_cond_set_condition (gimple stmt, enum tree_code code, tree lhs, tree rhs)
2488 {
2489   gimple_cond_set_code (stmt, code);
2490   gimple_cond_set_lhs (stmt, lhs);
2491   gimple_cond_set_rhs (stmt, rhs);
2492 }
2493
2494 /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS.  */
2495
2496 static inline tree
2497 gimple_label_label (const_gimple gs)
2498 {
2499   GIMPLE_CHECK (gs, GIMPLE_LABEL);
2500   return gimple_op (gs, 0);
2501 }
2502
2503
2504 /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
2505    GS.  */
2506
2507 static inline void
2508 gimple_label_set_label (gimple gs, tree label)
2509 {
2510   GIMPLE_CHECK (gs, GIMPLE_LABEL);
2511   gimple_set_op (gs, 0, label);
2512 }
2513
2514
2515 /* Return the destination of the unconditional jump GS.  */
2516
2517 static inline tree
2518 gimple_goto_dest (const_gimple gs)
2519 {
2520   GIMPLE_CHECK (gs, GIMPLE_GOTO);
2521   return gimple_op (gs, 0);
2522 }
2523
2524
2525 /* Set DEST to be the destination of the unconditonal jump GS.  */
2526
2527 static inline void
2528 gimple_goto_set_dest (gimple gs, tree dest)
2529 {
2530   GIMPLE_CHECK (gs, GIMPLE_GOTO);
2531   gimple_set_op (gs, 0, dest);
2532 }
2533
2534
2535 /* Return the variables declared in the GIMPLE_BIND statement GS.  */
2536
2537 static inline tree
2538 gimple_bind_vars (const_gimple gs)
2539 {
2540   GIMPLE_CHECK (gs, GIMPLE_BIND);
2541   return gs->gimple_bind.vars;
2542 }
2543
2544
2545 /* Set VARS to be the set of variables declared in the GIMPLE_BIND
2546    statement GS.  */
2547
2548 static inline void
2549 gimple_bind_set_vars (gimple gs, tree vars)
2550 {
2551   GIMPLE_CHECK (gs, GIMPLE_BIND);
2552   gs->gimple_bind.vars = vars;
2553 }
2554
2555
2556 /* Append VARS to the set of variables declared in the GIMPLE_BIND
2557    statement GS.  */
2558
2559 static inline void
2560 gimple_bind_append_vars (gimple gs, tree vars)
2561 {
2562   GIMPLE_CHECK (gs, GIMPLE_BIND);
2563   gs->gimple_bind.vars = chainon (gs->gimple_bind.vars, vars);
2564 }
2565
2566
2567 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS.  */
2568
2569 static inline gimple_seq
2570 gimple_bind_body (gimple gs)
2571 {
2572   GIMPLE_CHECK (gs, GIMPLE_BIND);
2573   return gs->gimple_bind.body;
2574 }
2575
2576
2577 /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
2578    statement GS.  */
2579
2580 static inline void
2581 gimple_bind_set_body (gimple gs, gimple_seq seq)
2582 {
2583   GIMPLE_CHECK (gs, GIMPLE_BIND);
2584   gs->gimple_bind.body = seq;
2585 }
2586
2587
2588 /* Append a statement to the end of a GIMPLE_BIND's body.  */
2589
2590 static inline void
2591 gimple_bind_add_stmt (gimple gs, gimple stmt)
2592 {
2593   GIMPLE_CHECK (gs, GIMPLE_BIND);
2594   gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
2595 }
2596
2597
2598 /* Append a sequence of statements to the end of a GIMPLE_BIND's body.  */
2599
2600 static inline void
2601 gimple_bind_add_seq (gimple gs, gimple_seq seq)
2602 {
2603   GIMPLE_CHECK (gs, GIMPLE_BIND);
2604   gimple_seq_add_seq (&gs->gimple_bind.body, seq);
2605 }
2606
2607
2608 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
2609    GS.  This is analogous to the BIND_EXPR_BLOCK field in trees.  */
2610
2611 static inline tree
2612 gimple_bind_block (const_gimple gs)
2613 {
2614   GIMPLE_CHECK (gs, GIMPLE_BIND);
2615   return gs->gimple_bind.block;
2616 }
2617
2618
2619 /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
2620    statement GS.  */
2621
2622 static inline void
2623 gimple_bind_set_block (gimple gs, tree block)
2624 {
2625   GIMPLE_CHECK (gs, GIMPLE_BIND);
2626   gcc_assert (block == NULL_TREE || TREE_CODE (block) == BLOCK);
2627   gs->gimple_bind.block = block;
2628 }
2629
2630
2631 /* Return the number of input operands for GIMPLE_ASM GS.  */
2632
2633 static inline unsigned
2634 gimple_asm_ninputs (const_gimple gs)
2635 {
2636   GIMPLE_CHECK (gs, GIMPLE_ASM);
2637   return gs->gimple_asm.ni;
2638 }
2639
2640
2641 /* Return the number of output operands for GIMPLE_ASM GS.  */
2642
2643 static inline unsigned
2644 gimple_asm_noutputs (const_gimple gs)
2645 {
2646   GIMPLE_CHECK (gs, GIMPLE_ASM);
2647   return gs->gimple_asm.no;
2648 }
2649
2650
2651 /* Return the number of clobber operands for GIMPLE_ASM GS.  */
2652
2653 static inline unsigned
2654 gimple_asm_nclobbers (const_gimple gs)
2655 {
2656   GIMPLE_CHECK (gs, GIMPLE_ASM);
2657   return gs->gimple_asm.nc;
2658 }
2659
2660 /* Return the number of label operands for GIMPLE_ASM GS.  */
2661
2662 static inline unsigned
2663 gimple_asm_nlabels (const_gimple gs)
2664 {
2665   GIMPLE_CHECK (gs, GIMPLE_ASM);
2666   return gs->gimple_asm.nl;
2667 }
2668
2669 /* Return input operand INDEX of GIMPLE_ASM GS.  */
2670
2671 static inline tree
2672 gimple_asm_input_op (const_gimple gs, unsigned index)
2673 {
2674   GIMPLE_CHECK (gs, GIMPLE_ASM);
2675   gcc_assert (index <= gs->gimple_asm.ni);
2676   return gimple_op (gs, index);
2677 }
2678
2679 /* Return a pointer to input operand INDEX of GIMPLE_ASM GS.  */
2680
2681 static inline tree *
2682 gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
2683 {
2684   GIMPLE_CHECK (gs, GIMPLE_ASM);
2685   gcc_assert (index <= gs->gimple_asm.ni);
2686   return gimple_op_ptr (gs, index);
2687 }
2688
2689
2690 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM GS.  */
2691
2692 static inline void
2693 gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
2694 {
2695   GIMPLE_CHECK (gs, GIMPLE_ASM);
2696   gcc_assert (index <= gs->gimple_asm.ni);
2697   gcc_assert (TREE_CODE (in_op) == TREE_LIST);
2698   gimple_set_op (gs, index, in_op);
2699 }
2700
2701
2702 /* Return output operand INDEX of GIMPLE_ASM GS.  */
2703
2704 static inline tree
2705 gimple_asm_output_op (const_gimple gs, unsigned index)
2706 {
2707   GIMPLE_CHECK (gs, GIMPLE_ASM);
2708   gcc_assert (index <= gs->gimple_asm.no);
2709   return gimple_op (gs, index + gs->gimple_asm.ni);
2710 }
2711
2712 /* Return a pointer to output operand INDEX of GIMPLE_ASM GS.  */
2713
2714 static inline tree *
2715 gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
2716 {
2717   GIMPLE_CHECK (gs, GIMPLE_ASM);
2718   gcc_assert (index <= gs->gimple_asm.no);
2719   return gimple_op_ptr (gs, index + gs->gimple_asm.ni);
2720 }
2721
2722
2723 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM GS.  */
2724
2725 static inline void
2726 gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
2727 {
2728   GIMPLE_CHECK (gs, GIMPLE_ASM);
2729   gcc_assert (index <= gs->gimple_asm.no);
2730   gcc_assert (TREE_CODE (out_op) == TREE_LIST);
2731   gimple_set_op (gs, index + gs->gimple_asm.ni, out_op);
2732 }
2733
2734
2735 /* Return clobber operand INDEX of GIMPLE_ASM GS.  */
2736
2737 static inline tree
2738 gimple_asm_clobber_op (const_gimple gs, unsigned index)
2739 {
2740   GIMPLE_CHECK (gs, GIMPLE_ASM);
2741   gcc_assert (index <= gs->gimple_asm.nc);
2742   return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
2743 }
2744
2745
2746 /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM GS.  */
2747
2748 static inline void
2749 gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
2750 {
2751   GIMPLE_CHECK (gs, GIMPLE_ASM);
2752   gcc_assert (index <= gs->gimple_asm.nc);
2753   gcc_assert (TREE_CODE (clobber_op) == TREE_LIST);
2754   gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
2755 }
2756
2757 /* Return label operand INDEX of GIMPLE_ASM GS.  */
2758
2759 static inline tree
2760 gimple_asm_label_op (const_gimple gs, unsigned index)
2761 {
2762   GIMPLE_CHECK (gs, GIMPLE_ASM);
2763   gcc_assert (index <= gs->gimple_asm.nl);
2764   return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
2765 }
2766
2767 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS.  */
2768
2769 static inline void
2770 gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
2771 {
2772   GIMPLE_CHECK (gs, GIMPLE_ASM);
2773   gcc_assert (index <= gs->gimple_asm.nl);
2774   gcc_assert (TREE_CODE (label_op) == TREE_LIST);
2775   gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
2776 }
2777
2778 /* Return the string representing the assembly instruction in
2779    GIMPLE_ASM GS.  */
2780
2781 static inline const char *
2782 gimple_asm_string (const_gimple gs)
2783 {
2784   GIMPLE_CHECK (gs, GIMPLE_ASM);
2785   return gs->gimple_asm.string;
2786 }
2787
2788
2789 /* Return true if GS is an asm statement marked volatile.  */
2790
2791 static inline bool
2792 gimple_asm_volatile_p (const_gimple gs)
2793 {
2794   GIMPLE_CHECK (gs, GIMPLE_ASM);
2795   return (gs->gsbase.subcode & GF_ASM_VOLATILE) != 0;
2796 }
2797
2798
2799 /* If VOLATLE_P is true, mark asm statement GS as volatile.  */
2800
2801 static inline void
2802 gimple_asm_set_volatile (gimple gs, bool volatile_p)
2803 {
2804   GIMPLE_CHECK (gs, GIMPLE_ASM);
2805   if (volatile_p)
2806     gs->gsbase.subcode |= GF_ASM_VOLATILE;
2807   else
2808     gs->gsbase.subcode &= ~GF_ASM_VOLATILE;
2809 }
2810
2811
2812 /* If INPUT_P is true, mark asm GS as an ASM_INPUT.  */
2813
2814 static inline void
2815 gimple_asm_set_input (gimple gs, bool input_p)
2816 {
2817   GIMPLE_CHECK (gs, GIMPLE_ASM);
2818   if (input_p)
2819     gs->gsbase.subcode |= GF_ASM_INPUT;
2820   else
2821     gs->gsbase.subcode &= ~GF_ASM_INPUT;
2822 }
2823
2824
2825 /* Return true if asm GS is an ASM_INPUT.  */
2826
2827 static inline bool
2828 gimple_asm_input_p (const_gimple gs)
2829 {
2830   GIMPLE_CHECK (gs, GIMPLE_ASM);
2831   return (gs->gsbase.subcode & GF_ASM_INPUT) != 0;
2832 }
2833
2834
2835 /* Return the types handled by GIMPLE_CATCH statement GS.  */
2836
2837 static inline tree
2838 gimple_catch_types (const_gimple gs)
2839 {
2840   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2841   return gs->gimple_catch.types;
2842 }
2843
2844
2845 /* Return a pointer to the types handled by GIMPLE_CATCH statement GS.  */
2846
2847 static inline tree *
2848 gimple_catch_types_ptr (gimple gs)
2849 {
2850   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2851   return &gs->gimple_catch.types;
2852 }
2853
2854
2855 /* Return the GIMPLE sequence representing the body of the handler of
2856    GIMPLE_CATCH statement GS.  */
2857
2858 static inline gimple_seq
2859 gimple_catch_handler (gimple gs)
2860 {
2861   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2862   return gs->gimple_catch.handler;
2863 }
2864
2865
2866 /* Return a pointer to the GIMPLE sequence representing the body of
2867    the handler of GIMPLE_CATCH statement GS.  */
2868
2869 static inline gimple_seq *
2870 gimple_catch_handler_ptr (gimple gs)
2871 {
2872   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2873   return &gs->gimple_catch.handler;
2874 }
2875
2876
2877 /* Set T to be the set of types handled by GIMPLE_CATCH GS.  */
2878
2879 static inline void
2880 gimple_catch_set_types (gimple gs, tree t)
2881 {
2882   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2883   gs->gimple_catch.types = t;
2884 }
2885
2886
2887 /* Set HANDLER to be the body of GIMPLE_CATCH GS.  */
2888
2889 static inline void
2890 gimple_catch_set_handler (gimple gs, gimple_seq handler)
2891 {
2892   GIMPLE_CHECK (gs, GIMPLE_CATCH);
2893   gs->gimple_catch.handler = handler;
2894 }
2895
2896
2897 /* Return the types handled by GIMPLE_EH_FILTER statement GS.  */
2898
2899 static inline tree
2900 gimple_eh_filter_types (const_gimple gs)
2901 {
2902   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2903   return gs->gimple_eh_filter.types;
2904 }
2905
2906
2907 /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
2908    GS.  */
2909
2910 static inline tree *
2911 gimple_eh_filter_types_ptr (gimple gs)
2912 {
2913   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2914   return &gs->gimple_eh_filter.types;
2915 }
2916
2917
2918 /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
2919    statement fails.  */
2920
2921 static inline gimple_seq
2922 gimple_eh_filter_failure (gimple gs)
2923 {
2924   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2925   return gs->gimple_eh_filter.failure;
2926 }
2927
2928
2929 /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER GS.  */
2930
2931 static inline void
2932 gimple_eh_filter_set_types (gimple gs, tree types)
2933 {
2934   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2935   gs->gimple_eh_filter.types = types;
2936 }
2937
2938
2939 /* Set FAILURE to be the sequence of statements to execute on failure
2940    for GIMPLE_EH_FILTER GS.  */
2941
2942 static inline void
2943 gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
2944 {
2945   GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
2946   gs->gimple_eh_filter.failure = failure;
2947 }
2948
2949 /* Get the function decl to be called by the MUST_NOT_THROW region.  */
2950
2951 static inline tree
2952 gimple_eh_must_not_throw_fndecl (gimple gs)
2953 {
2954   GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
2955   return gs->gimple_eh_mnt.fndecl;
2956 }
2957
2958 /* Set the function decl to be called by GS to DECL.  */
2959
2960 static inline void
2961 gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
2962 {
2963   GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
2964   gs->gimple_eh_mnt.fndecl = decl;
2965 }
2966
2967
2968 /* GIMPLE_TRY accessors. */
2969
2970 /* Return the kind of try block represented by GIMPLE_TRY GS.  This is
2971    either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY.  */
2972
2973 static inline enum gimple_try_flags
2974 gimple_try_kind (const_gimple gs)
2975 {
2976   GIMPLE_CHECK (gs, GIMPLE_TRY);
2977   return (enum gimple_try_flags) (gs->gsbase.subcode & GIMPLE_TRY_KIND);
2978 }
2979
2980
2981 /* Set the kind of try block represented by GIMPLE_TRY GS.  */
2982
2983 static inline void
2984 gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
2985 {
2986   GIMPLE_CHECK (gs, GIMPLE_TRY);
2987   gcc_assert (kind == GIMPLE_TRY_CATCH || kind == GIMPLE_TRY_FINALLY);
2988   if (gimple_try_kind (gs) != kind)
2989     gs->gsbase.subcode = (unsigned int) kind;
2990 }
2991
2992
2993 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag.  */
2994
2995 static inline bool
2996 gimple_try_catch_is_cleanup (const_gimple gs)
2997 {
2998   gcc_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
2999   return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
3000 }
3001
3002
3003 /* Return the sequence of statements used as the body for GIMPLE_TRY GS.  */
3004
3005 static inline gimple_seq
3006 gimple_try_eval (gimple gs)
3007 {
3008   GIMPLE_CHECK (gs, GIMPLE_TRY);
3009   return gs->gimple_try.eval;
3010 }
3011
3012
3013 /* Return the sequence of statements used as the cleanup body for
3014    GIMPLE_TRY GS.  */
3015
3016 static inline gimple_seq
3017 gimple_try_cleanup (gimple gs)
3018 {
3019   GIMPLE_CHECK (gs, GIMPLE_TRY);
3020   return gs->gimple_try.cleanup;
3021 }
3022
3023
3024 /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag.  */
3025
3026 static inline void
3027 gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
3028 {
3029   gcc_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
3030   if (catch_is_cleanup)
3031     g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
3032   else
3033     g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
3034 }
3035
3036
3037 /* Set EVAL to be the sequence of statements to use as the body for
3038    GIMPLE_TRY GS.  */
3039
3040 static inline void
3041 gimple_try_set_eval (gimple gs, gimple_seq eval)
3042 {
3043   GIMPLE_CHECK (gs, GIMPLE_TRY);
3044   gs->gimple_try.eval = eval;
3045 }
3046
3047
3048 /* Set CLEANUP to be the sequence of statements to use as the cleanup
3049    body for GIMPLE_TRY GS.  */
3050
3051 static inline void
3052 gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
3053 {
3054   GIMPLE_CHECK (gs, GIMPLE_TRY);
3055   gs->gimple_try.cleanup = cleanup;
3056 }
3057
3058
3059 /* Return the cleanup sequence for cleanup statement GS.  */
3060
3061 static inline gimple_seq
3062 gimple_wce_cleanup (gimple gs)
3063 {
3064   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3065   return gs->gimple_wce.cleanup;
3066 }
3067
3068
3069 /* Set CLEANUP to be the cleanup sequence for GS.  */
3070
3071 static inline void
3072 gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
3073 {
3074   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3075   gs->gimple_wce.cleanup = cleanup;
3076 }
3077
3078
3079 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple.  */
3080
3081 static inline bool
3082 gimple_wce_cleanup_eh_only (const_gimple gs)
3083 {
3084   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3085   return gs->gsbase.subcode != 0;
3086 }
3087
3088
3089 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple.  */
3090
3091 static inline void
3092 gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
3093 {
3094   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
3095   gs->gsbase.subcode = (unsigned int) eh_only_p;
3096 }
3097
3098
3099 /* Return the maximum number of arguments supported by GIMPLE_PHI GS.  */
3100
3101 static inline unsigned
3102 gimple_phi_capacity (const_gimple gs)
3103 {
3104   GIMPLE_CHECK (gs, GIMPLE_PHI);
3105   return gs->gimple_phi.capacity;
3106 }
3107
3108
3109 /* Return the number of arguments in GIMPLE_PHI GS.  This must always
3110    be exactly the number of incoming edges for the basic block holding
3111    GS.  */
3112
3113 static inline unsigned
3114 gimple_phi_num_args (const_gimple gs)
3115 {
3116   GIMPLE_CHECK (gs, GIMPLE_PHI);
3117   return gs->gimple_phi.nargs;
3118 }
3119
3120
3121 /* Return the SSA name created by GIMPLE_PHI GS.  */
3122
3123 static inline tree
3124 gimple_phi_result (const_gimple gs)
3125 {
3126   GIMPLE_CHECK (gs, GIMPLE_PHI);
3127   return gs->gimple_phi.result;
3128 }
3129
3130 /* Return a pointer to the SSA name created by GIMPLE_PHI GS.  */
3131
3132 static inline tree *
3133 gimple_phi_result_ptr (gimple gs)
3134 {
3135   GIMPLE_CHECK (gs, GIMPLE_PHI);
3136   return &gs->gimple_phi.result;
3137 }
3138
3139 /* Set RESULT to be the SSA name created by GIMPLE_PHI GS.  */
3140
3141 static inline void
3142 gimple_phi_set_result (gimple gs, tree result)
3143 {
3144   GIMPLE_CHECK (gs, GIMPLE_PHI);
3145   gs->gimple_phi.result = result;
3146 }
3147
3148
3149 /* Return the PHI argument corresponding to incoming edge INDEX for
3150    GIMPLE_PHI GS.  */
3151
3152 static inline struct phi_arg_d *
3153 gimple_phi_arg (gimple gs, unsigned index)
3154 {
3155   GIMPLE_CHECK (gs, GIMPLE_PHI);
3156   gcc_assert (index <= gs->gimple_phi.capacity);
3157   return &(gs->gimple_phi.args[index]);
3158 }
3159
3160 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
3161    for GIMPLE_PHI GS.  */
3162
3163 static inline void
3164 gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
3165 {
3166   GIMPLE_CHECK (gs, GIMPLE_PHI);
3167   gcc_assert (index <= gs->gimple_phi.nargs);
3168   memcpy (gs->gimple_phi.args + index, phiarg, sizeof (struct phi_arg_d));
3169 }
3170
3171 /* Return the region number for GIMPLE_RESX GS.  */
3172
3173 static inline int
3174 gimple_resx_region (const_gimple gs)
3175 {
3176   GIMPLE_CHECK (gs, GIMPLE_RESX);
3177   return gs->gimple_eh_ctrl.region;
3178 }
3179
3180 /* Set REGION to be the region number for GIMPLE_RESX GS.  */
3181
3182 static inline void
3183 gimple_resx_set_region (gimple gs, int region)
3184 {
3185   GIMPLE_CHECK (gs, GIMPLE_RESX);
3186   gs->gimple_eh_ctrl.region = region;
3187 }
3188
3189 /* Return the region number for GIMPLE_EH_DISPATCH GS.  */
3190
3191 static inline int
3192 gimple_eh_dispatch_region (const_gimple gs)
3193 {
3194   GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3195   return gs->gimple_eh_ctrl.region;
3196 }
3197
3198 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS.  */
3199
3200 static inline void
3201 gimple_eh_dispatch_set_region (gimple gs, int region)
3202 {
3203   GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
3204   gs->gimple_eh_ctrl.region = region;
3205 }
3206
3207 /* Return the number of labels associated with the switch statement GS.  */
3208
3209 static inline unsigned
3210 gimple_switch_num_labels (const_gimple gs)
3211 {
3212   unsigned num_ops;
3213   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3214   num_ops = gimple_num_ops (gs);
3215   gcc_assert (num_ops > 1);
3216   return num_ops - 1;
3217 }
3218
3219
3220 /* Set NLABELS to be the number of labels for the switch statement GS.  */
3221
3222 static inline void
3223 gimple_switch_set_num_labels (gimple g, unsigned nlabels)
3224 {
3225   GIMPLE_CHECK (g, GIMPLE_SWITCH);
3226   gimple_set_num_ops (g, nlabels + 1);
3227 }
3228
3229
3230 /* Return the index variable used by the switch statement GS.  */
3231
3232 static inline tree
3233 gimple_switch_index (const_gimple gs)
3234 {
3235   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3236   return gimple_op (gs, 0);
3237 }
3238
3239
3240 /* Return a pointer to the index variable for the switch statement GS.  */
3241
3242 static inline tree *
3243 gimple_switch_index_ptr (const_gimple gs)
3244 {
3245   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3246   return gimple_op_ptr (gs, 0);
3247 }
3248
3249
3250 /* Set INDEX to be the index variable for switch statement GS.  */
3251
3252 static inline void
3253 gimple_switch_set_index (gimple gs, tree index)
3254 {
3255   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3256   gcc_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
3257   gimple_set_op (gs, 0, index);
3258 }
3259
3260
3261 /* Return the label numbered INDEX.  The default label is 0, followed by any
3262    labels in a switch statement.  */
3263
3264 static inline tree
3265 gimple_switch_label (const_gimple gs, unsigned index)
3266 {
3267   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3268   gcc_assert (gimple_num_ops (gs) > index + 1);
3269   return gimple_op (gs, index + 1);
3270 }
3271
3272 /* Set the label number INDEX to LABEL.  0 is always the default label.  */
3273
3274 static inline void
3275 gimple_switch_set_label (gimple gs, unsigned index, tree label)
3276 {
3277   GIMPLE_CHECK (gs, GIMPLE_SWITCH);
3278   gcc_assert (gimple_num_ops (gs) > index + 1);
3279   gcc_assert (label == NULL_TREE || TREE_CODE (label) == CASE_LABEL_EXPR);
3280   gimple_set_op (gs, index + 1, label);
3281 }
3282
3283 /* Return the default label for a switch statement.  */
3284
3285 static inline tree
3286 gimple_switch_default_label (const_gimple gs)
3287 {
3288   return gimple_switch_label (gs, 0);
3289 }
3290
3291 /* Set the default label for a switch statement.  */
3292
3293 static inline void
3294 gimple_switch_set_default_label (gimple gs, tree label)
3295 {
3296   gimple_switch_set_label (gs, 0, label);
3297 }
3298
3299 /* Return true if GS is a GIMPLE_DEBUG statement.  */
3300
3301 static inline bool
3302 is_gimple_debug (const_gimple gs)
3303 {
3304   return gimple_code (gs) == GIMPLE_DEBUG;
3305 }
3306
3307 /* Return true if S is a GIMPLE_DEBUG BIND statement.  */
3308
3309 static inline bool
3310 gimple_debug_bind_p (const_gimple s)
3311 {
3312   if (is_gimple_debug (s))
3313     return s->gsbase.subcode == GIMPLE_DEBUG_BIND;
3314
3315   return false;
3316 }
3317
3318 /* Return the variable bound in a GIMPLE_DEBUG bind statement.  */
3319
3320 static inline tree
3321 gimple_debug_bind_get_var (gimple dbg)
3322 {
3323   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3324 #ifdef ENABLE_CHECKING
3325   gcc_assert (gimple_debug_bind_p (dbg));
3326 #endif
3327   return gimple_op (dbg, 0);
3328 }
3329
3330 /* Return the value bound to the variable in a GIMPLE_DEBUG bind
3331    statement.  */
3332
3333 static inline tree
3334 gimple_debug_bind_get_value (gimple dbg)
3335 {
3336   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3337 #ifdef ENABLE_CHECKING
3338   gcc_assert (gimple_debug_bind_p (dbg));
3339 #endif
3340   return gimple_op (dbg, 1);
3341 }
3342
3343 /* Return a pointer to the value bound to the variable in a
3344    GIMPLE_DEBUG bind statement.  */
3345
3346 static inline tree *
3347 gimple_debug_bind_get_value_ptr (gimple dbg)
3348 {
3349   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3350 #ifdef ENABLE_CHECKING
3351   gcc_assert (gimple_debug_bind_p (dbg));
3352 #endif
3353   return gimple_op_ptr (dbg, 1);
3354 }
3355
3356 /* Set the variable bound in a GIMPLE_DEBUG bind statement.  */
3357
3358 static inline void
3359 gimple_debug_bind_set_var (gimple dbg, tree var)
3360 {
3361   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3362 #ifdef ENABLE_CHECKING
3363   gcc_assert (gimple_debug_bind_p (dbg));
3364 #endif
3365   gimple_set_op (dbg, 0, var);
3366 }
3367
3368 /* Set the value bound to the variable in a GIMPLE_DEBUG bind
3369    statement.  */
3370
3371 static inline void
3372 gimple_debug_bind_set_value (gimple dbg, tree value)
3373 {
3374   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3375 #ifdef ENABLE_CHECKING
3376   gcc_assert (gimple_debug_bind_p (dbg));
3377 #endif
3378   gimple_set_op (dbg, 1, value);
3379 }
3380
3381 /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
3382    optimized away.  */
3383 #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
3384
3385 /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
3386    statement.  */
3387
3388 static inline void
3389 gimple_debug_bind_reset_value (gimple dbg)
3390 {
3391   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3392 #ifdef ENABLE_CHECKING
3393   gcc_assert (gimple_debug_bind_p (dbg));
3394 #endif
3395   gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
3396 }
3397
3398 /* Return true if the GIMPLE_DEBUG bind statement is bound to a
3399    value.  */
3400
3401 static inline bool
3402 gimple_debug_bind_has_value_p (gimple dbg)
3403 {
3404   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
3405 #ifdef ENABLE_CHECKING
3406   gcc_assert (gimple_debug_bind_p (dbg));
3407 #endif
3408   return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
3409 }
3410
3411 #undef GIMPLE_DEBUG_BIND_NOVALUE
3412
3413 /* Return the body for the OMP statement GS.  */
3414
3415 static inline gimple_seq
3416 gimple_omp_body (gimple gs)
3417 {
3418   return gs->omp.body;
3419 }
3420
3421 /* Set BODY to be the body for the OMP statement GS.  */
3422
3423 static inline void
3424 gimple_omp_set_body (gimple gs, gimple_seq body)
3425 {
3426   gs->omp.body = body;
3427 }
3428
3429
3430 /* Return the name associated with OMP_CRITICAL statement GS.  */
3431
3432 static inline tree
3433 gimple_omp_critical_name (const_gimple gs)
3434 {
3435   GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3436   return gs->gimple_omp_critical.name;
3437 }
3438
3439
3440 /* Return a pointer to the name associated with OMP critical statement GS.  */
3441
3442 static inline tree *
3443 gimple_omp_critical_name_ptr (gimple gs)
3444 {
3445   GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3446   return &gs->gimple_omp_critical.name;
3447 }
3448
3449
3450 /* Set NAME to be the name associated with OMP critical statement GS.  */
3451
3452 static inline void
3453 gimple_omp_critical_set_name (gimple gs, tree name)
3454 {
3455   GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
3456   gs->gimple_omp_critical.name = name;
3457 }
3458
3459
3460 /* Return the clauses associated with OMP_FOR GS.  */
3461
3462 static inline tree
3463 gimple_omp_for_clauses (const_gimple gs)
3464 {
3465   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3466   return gs->gimple_omp_for.clauses;
3467 }
3468
3469
3470 /* Return a pointer to the OMP_FOR GS.  */
3471
3472 static inline tree *
3473 gimple_omp_for_clauses_ptr (gimple gs)
3474 {
3475   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3476   return &gs->gimple_omp_for.clauses;
3477 }
3478
3479
3480 /* Set CLAUSES to be the list of clauses associated with OMP_FOR GS.  */
3481
3482 static inline void
3483 gimple_omp_for_set_clauses (gimple gs, tree clauses)
3484 {
3485   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3486   gs->gimple_omp_for.clauses = clauses;
3487 }
3488
3489
3490 /* Get the collapse count of OMP_FOR GS.  */
3491
3492 static inline size_t
3493 gimple_omp_for_collapse (gimple gs)
3494 {
3495   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3496   return gs->gimple_omp_for.collapse;
3497 }
3498
3499
3500 /* Return the index variable for OMP_FOR GS.  */
3501
3502 static inline tree
3503 gimple_omp_for_index (const_gimple gs, size_t i)
3504 {
3505   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3506   gcc_assert (i < gs->gimple_omp_for.collapse);
3507   return gs->gimple_omp_for.iter[i].index;
3508 }
3509
3510
3511 /* Return a pointer to the index variable for OMP_FOR GS.  */
3512
3513 static inline tree *
3514 gimple_omp_for_index_ptr (gimple gs, size_t i)
3515 {
3516   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3517   gcc_assert (i < gs->gimple_omp_for.collapse);
3518   return &gs->gimple_omp_for.iter[i].index;
3519 }
3520
3521
3522 /* Set INDEX to be the index variable for OMP_FOR GS.  */
3523
3524 static inline void
3525 gimple_omp_for_set_index (gimple gs, size_t i, tree index)
3526 {
3527   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3528   gcc_assert (i < gs->gimple_omp_for.collapse);
3529   gs->gimple_omp_for.iter[i].index = index;
3530 }
3531
3532
3533 /* Return the initial value for OMP_FOR GS.  */
3534
3535 static inline tree
3536 gimple_omp_for_initial (const_gimple gs, size_t i)
3537 {
3538   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3539   gcc_assert (i < gs->gimple_omp_for.collapse);
3540   return gs->gimple_omp_for.iter[i].initial;
3541 }
3542
3543
3544 /* Return a pointer to the initial value for OMP_FOR GS.  */
3545
3546 static inline tree *
3547 gimple_omp_for_initial_ptr (gimple gs, size_t i)
3548 {
3549   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3550   gcc_assert (i < gs->gimple_omp_for.collapse);
3551   return &gs->gimple_omp_for.iter[i].initial;
3552 }
3553
3554
3555 /* Set INITIAL to be the initial value for OMP_FOR GS.  */
3556
3557 static inline void
3558 gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
3559 {
3560   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3561   gcc_assert (i < gs->gimple_omp_for.collapse);
3562   gs->gimple_omp_for.iter[i].initial = initial;
3563 }
3564
3565
3566 /* Return the final value for OMP_FOR GS.  */
3567
3568 static inline tree
3569 gimple_omp_for_final (const_gimple gs, size_t i)
3570 {
3571   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3572   gcc_assert (i < gs->gimple_omp_for.collapse);
3573   return gs->gimple_omp_for.iter[i].final;
3574 }
3575
3576
3577 /* Return a pointer to the final value for OMP_FOR GS.  */
3578
3579 static inline tree *
3580 gimple_omp_for_final_ptr (gimple gs, size_t i)
3581 {
3582   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3583   gcc_assert (i < gs->gimple_omp_for.collapse);
3584   return &gs->gimple_omp_for.iter[i].final;
3585 }
3586
3587
3588 /* Set FINAL to be the final value for OMP_FOR GS.  */
3589
3590 static inline void
3591 gimple_omp_for_set_final (gimple gs, size_t i, tree final)
3592 {
3593   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3594   gcc_assert (i < gs->gimple_omp_for.collapse);
3595   gs->gimple_omp_for.iter[i].final = final;
3596 }
3597
3598
3599 /* Return the increment value for OMP_FOR GS.  */
3600
3601 static inline tree
3602 gimple_omp_for_incr (const_gimple gs, size_t i)
3603 {
3604   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3605   gcc_assert (i < gs->gimple_omp_for.collapse);
3606   return gs->gimple_omp_for.iter[i].incr;
3607 }
3608
3609
3610 /* Return a pointer to the increment value for OMP_FOR GS.  */
3611
3612 static inline tree *
3613 gimple_omp_for_incr_ptr (gimple gs, size_t i)
3614 {
3615   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3616   gcc_assert (i < gs->gimple_omp_for.collapse);
3617   return &gs->gimple_omp_for.iter[i].incr;
3618 }
3619
3620
3621 /* Set INCR to be the increment value for OMP_FOR GS.  */
3622
3623 static inline void
3624 gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
3625 {
3626   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3627   gcc_assert (i < gs->gimple_omp_for.collapse);
3628   gs->gimple_omp_for.iter[i].incr = incr;
3629 }
3630
3631
3632 /* Return the sequence of statements to execute before the OMP_FOR
3633    statement GS starts.  */
3634
3635 static inline gimple_seq
3636 gimple_omp_for_pre_body (gimple gs)
3637 {
3638   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3639   return gs->gimple_omp_for.pre_body;
3640 }
3641
3642
3643 /* Set PRE_BODY to be the sequence of statements to execute before the
3644    OMP_FOR statement GS starts.  */
3645
3646 static inline void
3647 gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
3648 {
3649   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
3650   gs->gimple_omp_for.pre_body = pre_body;
3651 }
3652
3653
3654 /* Return the clauses associated with OMP_PARALLEL GS.  */
3655
3656 static inline tree
3657 gimple_omp_parallel_clauses (const_gimple gs)
3658 {
3659   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3660   return gs->gimple_omp_parallel.clauses;
3661 }
3662
3663
3664 /* Return a pointer to the clauses associated with OMP_PARALLEL GS.  */
3665
3666 static inline tree *
3667 gimple_omp_parallel_clauses_ptr (gimple gs)
3668 {
3669   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3670   return &gs->gimple_omp_parallel.clauses;
3671 }
3672
3673
3674 /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL
3675    GS.  */
3676
3677 static inline void
3678 gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
3679 {
3680   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3681   gs->gimple_omp_parallel.clauses = clauses;
3682 }
3683
3684
3685 /* Return the child function used to hold the body of OMP_PARALLEL GS.  */
3686
3687 static inline tree
3688 gimple_omp_parallel_child_fn (const_gimple gs)
3689 {
3690   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3691   return gs->gimple_omp_parallel.child_fn;
3692 }
3693
3694 /* Return a pointer to the child function used to hold the body of
3695    OMP_PARALLEL GS.  */
3696
3697 static inline tree *
3698 gimple_omp_parallel_child_fn_ptr (gimple gs)
3699 {
3700   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3701   return &gs->gimple_omp_parallel.child_fn;
3702 }
3703
3704
3705 /* Set CHILD_FN to be the child function for OMP_PARALLEL GS.  */
3706
3707 static inline void
3708 gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
3709 {
3710   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3711   gs->gimple_omp_parallel.child_fn = child_fn;
3712 }
3713
3714
3715 /* Return the artificial argument used to send variables and values
3716    from the parent to the children threads in OMP_PARALLEL GS.  */
3717
3718 static inline tree
3719 gimple_omp_parallel_data_arg (const_gimple gs)
3720 {
3721   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3722   return gs->gimple_omp_parallel.data_arg;
3723 }
3724
3725
3726 /* Return a pointer to the data argument for OMP_PARALLEL GS.  */
3727
3728 static inline tree *
3729 gimple_omp_parallel_data_arg_ptr (gimple gs)
3730 {
3731   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3732   return &gs->gimple_omp_parallel.data_arg;
3733 }
3734
3735
3736 /* Set DATA_ARG to be the data argument for OMP_PARALLEL GS.  */
3737
3738 static inline void
3739 gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
3740 {
3741   GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
3742   gs->gimple_omp_parallel.data_arg = data_arg;
3743 }
3744
3745
3746 /* Return the clauses associated with OMP_TASK GS.  */
3747
3748 static inline tree
3749 gimple_omp_task_clauses (const_gimple gs)
3750 {
3751   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3752   return gs->gimple_omp_parallel.clauses;
3753 }
3754
3755
3756 /* Return a pointer to the clauses associated with OMP_TASK GS.  */
3757
3758 static inline tree *
3759 gimple_omp_task_clauses_ptr (gimple gs)
3760 {
3761   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3762   return &gs->gimple_omp_parallel.clauses;
3763 }
3764
3765
3766 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
3767    GS.  */
3768
3769 static inline void
3770 gimple_omp_task_set_clauses (gimple gs, tree clauses)
3771 {
3772   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3773   gs->gimple_omp_parallel.clauses = clauses;
3774 }
3775
3776
3777 /* Return the child function used to hold the body of OMP_TASK GS.  */
3778
3779 static inline tree
3780 gimple_omp_task_child_fn (const_gimple gs)
3781 {
3782   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3783   return gs->gimple_omp_parallel.child_fn;
3784 }
3785
3786 /* Return a pointer to the child function used to hold the body of
3787    OMP_TASK GS.  */
3788
3789 static inline tree *
3790 gimple_omp_task_child_fn_ptr (gimple gs)
3791 {
3792   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3793   return &gs->gimple_omp_parallel.child_fn;
3794 }
3795
3796
3797 /* Set CHILD_FN to be the child function for OMP_TASK GS.  */
3798
3799 static inline void
3800 gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
3801 {
3802   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3803   gs->gimple_omp_parallel.child_fn = child_fn;
3804 }
3805
3806
3807 /* Return the artificial argument used to send variables and values
3808    from the parent to the children threads in OMP_TASK GS.  */
3809
3810 static inline tree
3811 gimple_omp_task_data_arg (const_gimple gs)
3812 {
3813   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3814   return gs->gimple_omp_parallel.data_arg;
3815 }
3816
3817
3818 /* Return a pointer to the data argument for OMP_TASK GS.  */
3819
3820 static inline tree *
3821 gimple_omp_task_data_arg_ptr (gimple gs)
3822 {
3823   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3824   return &gs->gimple_omp_parallel.data_arg;
3825 }
3826
3827
3828 /* Set DATA_ARG to be the data argument for OMP_TASK GS.  */
3829
3830 static inline void
3831 gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
3832 {
3833   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3834   gs->gimple_omp_parallel.data_arg = data_arg;
3835 }
3836
3837
3838 /* Return the clauses associated with OMP_TASK GS.  */
3839
3840 static inline tree
3841 gimple_omp_taskreg_clauses (const_gimple gs)
3842 {
3843   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3844     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3845   return gs->gimple_omp_parallel.clauses;
3846 }
3847
3848
3849 /* Return a pointer to the clauses associated with OMP_TASK GS.  */
3850
3851 static inline tree *
3852 gimple_omp_taskreg_clauses_ptr (gimple gs)
3853 {
3854   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3855     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3856   return &gs->gimple_omp_parallel.clauses;
3857 }
3858
3859
3860 /* Set CLAUSES to be the list of clauses associated with OMP_TASK
3861    GS.  */
3862
3863 static inline void
3864 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
3865 {
3866   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3867     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3868   gs->gimple_omp_parallel.clauses = clauses;
3869 }
3870
3871
3872 /* Return the child function used to hold the body of OMP_TASK GS.  */
3873
3874 static inline tree
3875 gimple_omp_taskreg_child_fn (const_gimple gs)
3876 {
3877   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3878     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3879   return gs->gimple_omp_parallel.child_fn;
3880 }
3881
3882 /* Return a pointer to the child function used to hold the body of
3883    OMP_TASK GS.  */
3884
3885 static inline tree *
3886 gimple_omp_taskreg_child_fn_ptr (gimple gs)
3887 {
3888   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3889     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3890   return &gs->gimple_omp_parallel.child_fn;
3891 }
3892
3893
3894 /* Set CHILD_FN to be the child function for OMP_TASK GS.  */
3895
3896 static inline void
3897 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
3898 {
3899   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3900     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3901   gs->gimple_omp_parallel.child_fn = child_fn;
3902 }
3903
3904
3905 /* Return the artificial argument used to send variables and values
3906    from the parent to the children threads in OMP_TASK GS.  */
3907
3908 static inline tree
3909 gimple_omp_taskreg_data_arg (const_gimple gs)
3910 {
3911   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3912     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3913   return gs->gimple_omp_parallel.data_arg;
3914 }
3915
3916
3917 /* Return a pointer to the data argument for OMP_TASK GS.  */
3918
3919 static inline tree *
3920 gimple_omp_taskreg_data_arg_ptr (gimple gs)
3921 {
3922   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3923     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3924   return &gs->gimple_omp_parallel.data_arg;
3925 }
3926
3927
3928 /* Set DATA_ARG to be the data argument for OMP_TASK GS.  */
3929
3930 static inline void
3931 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
3932 {
3933   if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
3934     GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3935   gs->gimple_omp_parallel.data_arg = data_arg;
3936 }
3937
3938
3939 /* Return the copy function used to hold the body of OMP_TASK GS.  */
3940
3941 static inline tree
3942 gimple_omp_task_copy_fn (const_gimple gs)
3943 {
3944   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3945   return gs->gimple_omp_task.copy_fn;
3946 }
3947
3948 /* Return a pointer to the copy function used to hold the body of
3949    OMP_TASK GS.  */
3950
3951 static inline tree *
3952 gimple_omp_task_copy_fn_ptr (gimple gs)
3953 {
3954   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3955   return &gs->gimple_omp_task.copy_fn;
3956 }
3957
3958
3959 /* Set CHILD_FN to be the copy function for OMP_TASK GS.  */
3960
3961 static inline void
3962 gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
3963 {
3964   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3965   gs->gimple_omp_task.copy_fn = copy_fn;
3966 }
3967
3968
3969 /* Return size of the data block in bytes in OMP_TASK GS.  */
3970
3971 static inline tree
3972 gimple_omp_task_arg_size (const_gimple gs)
3973 {
3974   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3975   return gs->gimple_omp_task.arg_size;
3976 }
3977
3978
3979 /* Return a pointer to the data block size for OMP_TASK GS.  */
3980
3981 static inline tree *
3982 gimple_omp_task_arg_size_ptr (gimple gs)
3983 {
3984   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3985   return &gs->gimple_omp_task.arg_size;
3986 }
3987
3988
3989 /* Set ARG_SIZE to be the data block size for OMP_TASK GS.  */
3990
3991 static inline void
3992 gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
3993 {
3994   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
3995   gs->gimple_omp_task.arg_size = arg_size;
3996 }
3997
3998
3999 /* Return align of the data block in bytes in OMP_TASK GS.  */
4000
4001 static inline tree
4002 gimple_omp_task_arg_align (const_gimple gs)
4003 {
4004   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4005   return gs->gimple_omp_task.arg_align;
4006 }
4007
4008
4009 /* Return a pointer to the data block align for OMP_TASK GS.  */
4010
4011 static inline tree *
4012 gimple_omp_task_arg_align_ptr (gimple gs)
4013 {
4014   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4015   return &gs->gimple_omp_task.arg_align;
4016 }
4017
4018
4019 /* Set ARG_SIZE to be the data block align for OMP_TASK GS.  */
4020
4021 static inline void
4022 gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
4023 {
4024   GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
4025   gs->gimple_omp_task.arg_align = arg_align;
4026 }
4027
4028
4029 /* Return the clauses associated with OMP_SINGLE GS.  */
4030
4031 static inline tree
4032 gimple_omp_single_clauses (const_gimple gs)
4033 {
4034   GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4035   return gs->gimple_omp_single.clauses;
4036 }
4037
4038
4039 /* Return a pointer to the clauses associated with OMP_SINGLE GS.  */
4040
4041 static inline tree *
4042 gimple_omp_single_clauses_ptr (gimple gs)
4043 {
4044   GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4045   return &gs->gimple_omp_single.clauses;
4046 }
4047
4048
4049 /* Set CLAUSES to be the clauses associated with OMP_SINGLE GS.  */
4050
4051 static inline void
4052 gimple_omp_single_set_clauses (gimple gs, tree clauses)
4053 {
4054   GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
4055   gs->gimple_omp_single.clauses = clauses;
4056 }
4057
4058
4059 /* Return the clauses associated with OMP_SECTIONS GS.  */
4060
4061 static inline tree
4062 gimple_omp_sections_clauses (const_gimple gs)
4063 {
4064   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4065   return gs->gimple_omp_sections.clauses;
4066 }
4067
4068
4069 /* Return a pointer to the clauses associated with OMP_SECTIONS GS.  */
4070
4071 static inline tree *
4072 gimple_omp_sections_clauses_ptr (gimple gs)
4073 {
4074   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4075   return &gs->gimple_omp_sections.clauses;
4076 }
4077
4078
4079 /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
4080    GS.  */
4081
4082 static inline void
4083 gimple_omp_sections_set_clauses (gimple gs, tree clauses)
4084 {
4085   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4086   gs->gimple_omp_sections.clauses = clauses;
4087 }
4088
4089
4090 /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
4091    in GS.  */
4092
4093 static inline tree
4094 gimple_omp_sections_control (const_gimple gs)
4095 {
4096   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4097   return gs->gimple_omp_sections.control;
4098 }
4099
4100
4101 /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
4102    GS.  */
4103
4104 static inline tree *
4105 gimple_omp_sections_control_ptr (gimple gs)
4106 {
4107   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4108   return &gs->gimple_omp_sections.control;
4109 }
4110
4111
4112 /* Set CONTROL to be the set of clauses associated with the
4113    GIMPLE_OMP_SECTIONS in GS.  */
4114
4115 static inline void
4116 gimple_omp_sections_set_control (gimple gs, tree control)
4117 {
4118   GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
4119   gs->gimple_omp_sections.control = control;
4120 }
4121
4122
4123 /* Set COND to be the condition code for OMP_FOR GS.  */
4124
4125 static inline void
4126 gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
4127 {
4128   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4129   gcc_assert (TREE_CODE_CLASS (cond) == tcc_comparison);
4130   gcc_assert (i < gs->gimple_omp_for.collapse);
4131   gs->gimple_omp_for.iter[i].cond = cond;
4132 }
4133
4134
4135 /* Return the condition code associated with OMP_FOR GS.  */
4136
4137 static inline enum tree_code
4138 gimple_omp_for_cond (const_gimple gs, size_t i)
4139 {
4140   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
4141   gcc_assert (i < gs->gimple_omp_for.collapse);
4142   return gs->gimple_omp_for.iter[i].cond;
4143 }
4144
4145
4146 /* Set the value being stored in an atomic store.  */
4147
4148 static inline void
4149 gimple_omp_atomic_store_set_val (gimple g, tree val)
4150 {
4151   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4152   g->gimple_omp_atomic_store.val = val;
4153 }
4154
4155
4156 /* Return the value being stored in an atomic store.  */
4157
4158 static inline tree
4159 gimple_omp_atomic_store_val (const_gimple g)
4160 {
4161   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4162   return g->gimple_omp_atomic_store.val;
4163 }
4164
4165
4166 /* Return a pointer to the value being stored in an atomic store.  */
4167
4168 static inline tree *
4169 gimple_omp_atomic_store_val_ptr (gimple g)
4170 {
4171   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
4172   return &g->gimple_omp_atomic_store.val;
4173 }
4174
4175
4176 /* Set the LHS of an atomic load.  */
4177
4178 static inline void
4179 gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
4180 {
4181   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4182   g->gimple_omp_atomic_load.lhs = lhs;
4183 }
4184
4185
4186 /* Get the LHS of an atomic load.  */
4187
4188 static inline tree
4189 gimple_omp_atomic_load_lhs (const_gimple g)
4190 {
4191   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4192   return g->gimple_omp_atomic_load.lhs;
4193 }
4194
4195
4196 /* Return a pointer to the LHS of an atomic load.  */
4197
4198 static inline tree *
4199 gimple_omp_atomic_load_lhs_ptr (gimple g)
4200 {
4201   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4202   return &g->gimple_omp_atomic_load.lhs;
4203 }
4204
4205
4206 /* Set the RHS of an atomic load.  */
4207
4208 static inline void
4209 gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
4210 {
4211   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4212   g->gimple_omp_atomic_load.rhs = rhs;
4213 }
4214
4215
4216 /* Get the RHS of an atomic load.  */
4217
4218 static inline tree
4219 gimple_omp_atomic_load_rhs (const_gimple g)
4220 {
4221   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4222   return g->gimple_omp_atomic_load.rhs;
4223 }
4224
4225
4226 /* Return a pointer to the RHS of an atomic load.  */
4227
4228 static inline tree *
4229 gimple_omp_atomic_load_rhs_ptr (gimple g)
4230 {
4231   GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
4232   return &g->gimple_omp_atomic_load.rhs;
4233 }
4234
4235
4236 /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE.  */
4237
4238 static inline tree
4239 gimple_omp_continue_control_def (const_gimple g)
4240 {
4241   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4242   return g->gimple_omp_continue.control_def;
4243 }
4244
4245 /* The same as above, but return the address.  */
4246
4247 static inline tree *
4248 gimple_omp_continue_control_def_ptr (gimple g)
4249 {
4250   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4251   return &g->gimple_omp_continue.control_def;
4252 }
4253
4254 /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE.  */
4255
4256 static inline void
4257 gimple_omp_continue_set_control_def (gimple g, tree def)
4258 {
4259   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4260   g->gimple_omp_continue.control_def = def;
4261 }
4262
4263
4264 /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE.  */
4265
4266 static inline tree
4267 gimple_omp_continue_control_use (const_gimple g)
4268 {
4269   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4270   return g->gimple_omp_continue.control_use;
4271 }
4272
4273
4274 /* The same as above, but return the address.  */
4275
4276 static inline tree *
4277 gimple_omp_continue_control_use_ptr (gimple g)
4278 {
4279   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4280   return &g->gimple_omp_continue.control_use;
4281 }
4282
4283
4284 /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE.  */
4285
4286 static inline void
4287 gimple_omp_continue_set_control_use (gimple g, tree use)
4288 {
4289   GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
4290   g->gimple_omp_continue.control_use = use;
4291 }
4292
4293
4294 /* Return a pointer to the return value for GIMPLE_RETURN GS.  */
4295
4296 static inline tree *
4297 gimple_return_retval_ptr (const_gimple gs)
4298 {
4299   GIMPLE_CHECK (gs, GIMPLE_RETURN);
4300   return gimple_op_ptr (gs, 0);
4301 }
4302
4303 /* Return the return value for GIMPLE_RETURN GS.  */
4304
4305 static inline tree
4306 gimple_return_retval (const_gimple gs)
4307 {
4308   GIMPLE_CHECK (gs, GIMPLE_RETURN);
4309   return gimple_op (gs, 0);
4310 }
4311
4312
4313 /* Set RETVAL to be the return value for GIMPLE_RETURN GS.  */
4314
4315 static inline void
4316 gimple_return_set_retval (gimple gs, tree retval)
4317 {
4318   GIMPLE_CHECK (gs, GIMPLE_RETURN);
4319   gimple_set_op (gs, 0, retval);
4320 }
4321
4322
4323 /* Returns true when the gimple statment STMT is any of the OpenMP types.  */
4324
4325 #define CASE_GIMPLE_OMP                         \
4326     case GIMPLE_OMP_PARALLEL:                   \
4327     case GIMPLE_OMP_TASK:                       \
4328     case GIMPLE_OMP_FOR:                        \
4329     case GIMPLE_OMP_SECTIONS:                   \
4330     case GIMPLE_OMP_SECTIONS_SWITCH:            \
4331     case GIMPLE_OMP_SINGLE:                     \
4332     case GIMPLE_OMP_SECTION:                    \
4333     case GIMPLE_OMP_MASTER:                     \
4334     case GIMPLE_OMP_ORDERED:                    \
4335     case GIMPLE_OMP_CRITICAL:                   \
4336     case GIMPLE_OMP_RETURN:                     \
4337     case GIMPLE_OMP_ATOMIC_LOAD:                \
4338     case GIMPLE_OMP_ATOMIC_STORE:               \
4339     case GIMPLE_OMP_CONTINUE
4340
4341 static inline bool
4342 is_gimple_omp (const_gimple stmt)
4343 {
4344   switch (gimple_code (stmt))
4345     {
4346     CASE_GIMPLE_OMP:
4347       return true;
4348     default:
4349       return false;
4350     }
4351 }
4352
4353
4354 /* Returns TRUE if statement G is a GIMPLE_NOP.  */
4355
4356 static inline bool
4357 gimple_nop_p (const_gimple g)
4358 {
4359   return gimple_code (g) == GIMPLE_NOP;
4360 }
4361
4362
4363 /* Return true if GS is a GIMPLE_RESX.  */
4364
4365 static inline bool
4366 is_gimple_resx (const_gimple gs)
4367 {
4368   return gimple_code (gs) == GIMPLE_RESX;
4369 }
4370
4371 /* Return the predictor of GIMPLE_PREDICT statement GS.  */
4372
4373 static inline enum br_predictor
4374 gimple_predict_predictor (gimple gs)
4375 {
4376   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4377   return (enum br_predictor) (gs->gsbase.subcode & ~GF_PREDICT_TAKEN);
4378 }
4379
4380
4381 /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT.  */
4382
4383 static inline void
4384 gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
4385 {
4386   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4387   gs->gsbase.subcode = (gs->gsbase.subcode & GF_PREDICT_TAKEN)
4388                        | (unsigned) predictor;
4389 }
4390
4391
4392 /* Return the outcome of GIMPLE_PREDICT statement GS.  */
4393
4394 static inline enum prediction
4395 gimple_predict_outcome (gimple gs)
4396 {
4397   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4398   return (gs->gsbase.subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
4399 }
4400
4401
4402 /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME.  */
4403
4404 static inline void
4405 gimple_predict_set_outcome (gimple gs, enum prediction outcome)
4406 {
4407   GIMPLE_CHECK (gs, GIMPLE_PREDICT);
4408   if (outcome == TAKEN)
4409     gs->gsbase.subcode |= GF_PREDICT_TAKEN;
4410   else
4411     gs->gsbase.subcode &= ~GF_PREDICT_TAKEN;
4412 }
4413
4414
4415 /* Return the type of the main expression computed by STMT.  Return
4416    void_type_node if the statement computes nothing.  */
4417
4418 static inline tree
4419 gimple_expr_type (const_gimple stmt)
4420 {
4421   enum gimple_code code = gimple_code (stmt);
4422
4423   if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
4424     {
4425       tree type;
4426       /* In general we want to pass out a type that can be substituted
4427          for both the RHS and the LHS types if there is a possibly
4428          useless conversion involved.  That means returning the
4429          original RHS type as far as we can reconstruct it.  */
4430       if (code == GIMPLE_CALL)
4431         type = gimple_call_return_type (stmt);
4432       else
4433         switch (gimple_assign_rhs_code (stmt))
4434           {
4435           case POINTER_PLUS_EXPR:
4436             type = TREE_TYPE (gimple_assign_rhs1 (stmt));
4437             break;
4438
4439           default:
4440             /* As fallback use the type of the LHS.  */
4441             type = TREE_TYPE (gimple_get_lhs (stmt));
4442             break;
4443           }
4444       return type;
4445     }
4446   else if (code == GIMPLE_COND)
4447     return boolean_type_node;
4448   else
4449     return void_type_node;
4450 }
4451
4452
4453 /* Return a new iterator pointing to GIMPLE_SEQ's first statement.  */
4454
4455 static inline gimple_stmt_iterator
4456 gsi_start (gimple_seq seq)
4457 {
4458   gimple_stmt_iterator i;
4459
4460   i.ptr = gimple_seq_first (seq);
4461   i.seq = seq;
4462   i.bb = (i.ptr && i.ptr->stmt) ? gimple_bb (i.ptr->stmt) : NULL;
4463
4464   return i;
4465 }
4466
4467
4468 /* Return a new iterator pointing to the first statement in basic block BB.  */
4469
4470 static inline gimple_stmt_iterator
4471 gsi_start_bb (basic_block bb)
4472 {
4473   gimple_stmt_iterator i;
4474   gimple_seq seq;
4475
4476   seq = bb_seq (bb);
4477   i.ptr = gimple_seq_first (seq);
4478   i.seq = seq;
4479   i.bb = bb;
4480
4481   return i;
4482 }
4483
4484
4485 /* Return a new iterator initially pointing to GIMPLE_SEQ's last statement.  */
4486
4487 static inline gimple_stmt_iterator
4488 gsi_last (gimple_seq seq)
4489 {
4490   gimple_stmt_iterator i;
4491
4492   i.ptr = gimple_seq_last (seq);
4493   i.seq = seq;
4494   i.bb = (i.ptr && i.ptr->stmt) ? gimple_bb (i.ptr->stmt) : NULL;
4495
4496   return i;
4497 }
4498
4499
4500 /* Return a new iterator pointing to the last statement in basic block BB.  */
4501
4502 static inline gimple_stmt_iterator
4503 gsi_last_bb (basic_block bb)
4504 {
4505   gimple_stmt_iterator i;
4506   gimple_seq seq;
4507
4508   seq = bb_seq (bb);
4509   i.ptr = gimple_seq_last (seq);
4510   i.seq = seq;
4511   i.bb = bb;
4512
4513   return i;
4514 }
4515
4516
4517 /* Return true if I is at the end of its sequence.  */
4518
4519 static inline bool
4520 gsi_end_p (gimple_stmt_iterator i)
4521 {
4522   return i.ptr == NULL;
4523 }
4524
4525
4526 /* Return true if I is one statement before the end of its sequence.  */
4527
4528 static inline bool
4529 gsi_one_before_end_p (gimple_stmt_iterator i)
4530 {
4531   return i.ptr != NULL && i.ptr->next == NULL;
4532 }
4533
4534
4535 /* Advance the iterator to the next gimple statement.  */
4536
4537 static inline void
4538 gsi_next (gimple_stmt_iterator *i)
4539 {
4540   i->ptr = i->ptr->next;
4541 }
4542
4543 /* Advance the iterator to the previous gimple statement.  */
4544
4545 static inline void
4546 gsi_prev (gimple_stmt_iterator *i)
4547 {
4548   i->ptr = i->ptr->prev;
4549 }
4550
4551 /* Return the current stmt.  */
4552
4553 static inline gimple
4554 gsi_stmt (gimple_stmt_iterator i)
4555 {
4556   return i.ptr->stmt;
4557 }
4558
4559 /* Return a block statement iterator that points to the first non-label
4560    statement in block BB.  */
4561
4562 static inline gimple_stmt_iterator
4563 gsi_after_labels (basic_block bb)
4564 {
4565   gimple_stmt_iterator gsi = gsi_start_bb (bb);
4566
4567   while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
4568     gsi_next (&gsi);
4569
4570   return gsi;
4571 }
4572
4573 /* Advance the iterator to the next non-debug gimple statement.  */
4574
4575 static inline void
4576 gsi_next_nondebug (gimple_stmt_iterator *i)
4577 {
4578   do
4579     {
4580       gsi_next (i);
4581     }
4582   while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
4583 }
4584
4585 /* Advance the iterator to the next non-debug gimple statement.  */
4586
4587 static inline void
4588 gsi_prev_nondebug (gimple_stmt_iterator *i)
4589 {
4590   do
4591     {
4592       gsi_prev (i);
4593     }
4594   while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
4595 }
4596
4597 /* Return a new iterator pointing to the first non-debug statement in
4598    basic block BB.  */
4599
4600 static inline gimple_stmt_iterator
4601 gsi_start_nondebug_bb (basic_block bb)
4602 {
4603   gimple_stmt_iterator i = gsi_start_bb (bb);
4604
4605   if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
4606     gsi_next_nondebug (&i);
4607
4608   return i;
4609 }
4610
4611 /* Return a new iterator pointing to the last non-debug statement in
4612    basic block BB.  */
4613
4614 static inline gimple_stmt_iterator
4615 gsi_last_nondebug_bb (basic_block bb)
4616 {
4617   gimple_stmt_iterator i = gsi_last_bb (bb);
4618
4619   if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
4620     gsi_prev_nondebug (&i);
4621
4622   return i;
4623 }
4624
4625 /* Return a pointer to the current stmt.
4626
4627   NOTE: You may want to use gsi_replace on the iterator itself,
4628   as this performs additional bookkeeping that will not be done
4629   if you simply assign through a pointer returned by gsi_stmt_ptr.  */
4630
4631 static inline gimple *
4632 gsi_stmt_ptr (gimple_stmt_iterator *i)
4633 {
4634   return &i->ptr->stmt;
4635 }
4636
4637
4638 /* Return the basic block associated with this iterator.  */
4639
4640 static inline basic_block
4641 gsi_bb (gimple_stmt_iterator i)
4642 {
4643   return i.bb;
4644 }
4645
4646
4647 /* Return the sequence associated with this iterator.  */
4648
4649 static inline gimple_seq
4650 gsi_seq (gimple_stmt_iterator i)
4651 {
4652   return i.seq;
4653 }
4654
4655
4656 enum gsi_iterator_update
4657 {
4658   GSI_NEW_STMT,         /* Only valid when single statement is added, move
4659                            iterator to it.  */
4660   GSI_SAME_STMT,        /* Leave the iterator at the same statement.  */
4661   GSI_CONTINUE_LINKING  /* Move iterator to whatever position is suitable
4662                            for linking other statements in the same
4663                            direction.  */
4664 };
4665
4666 /* In gimple-iterator.c  */
4667 gimple_stmt_iterator gsi_start_phis (basic_block);
4668 gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
4669 gimple_seq gsi_split_seq_before (gimple_stmt_iterator *);
4670 void gsi_replace (gimple_stmt_iterator *, gimple, bool);
4671 void gsi_insert_before (gimple_stmt_iterator *, gimple,
4672                         enum gsi_iterator_update);
4673 void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
4674                                        enum gsi_iterator_update);
4675 void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
4676                             enum gsi_iterator_update);
4677 void gsi_insert_seq_before_without_update (gimple_stmt_iterator *, gimple_seq,
4678                                            enum gsi_iterator_update);
4679 void gsi_insert_after (gimple_stmt_iterator *, gimple,
4680                        enum gsi_iterator_update);
4681 void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
4682                                       enum gsi_iterator_update);
4683 void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
4684                            enum gsi_iterator_update);
4685 void gsi_insert_seq_after_without_update (gimple_stmt_iterator *, gimple_seq,
4686                                           enum gsi_iterator_update);
4687 void gsi_remove (gimple_stmt_iterator *, bool);
4688 gimple_stmt_iterator gsi_for_stmt (gimple);
4689 void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
4690 void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
4691 void gsi_move_to_bb_end (gimple_stmt_iterator *, struct basic_block_def *);
4692 void gsi_insert_on_edge (edge, gimple);
4693 void gsi_insert_seq_on_edge (edge, gimple_seq);
4694 basic_block gsi_insert_on_edge_immediate (edge, gimple);
4695 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
4696 void gsi_commit_one_edge_insert (edge, basic_block *);
4697 void gsi_commit_edge_inserts (void);
4698 gimple gimple_call_copy_skip_args (gimple, bitmap);
4699
4700
4701 /* Convenience routines to walk all statements of a gimple function.
4702    Note that this is useful exclusively before the code is converted
4703    into SSA form.  Once the program is in SSA form, the standard
4704    operand interface should be used to analyze/modify statements.  */
4705 struct walk_stmt_info
4706 {
4707   /* Points to the current statement being walked.  */
4708   gimple_stmt_iterator gsi;
4709
4710   /* Additional data that the callback functions may want to carry
4711      through the recursion.  */
4712   void *info;
4713
4714   /* Pointer map used to mark visited tree nodes when calling
4715      walk_tree on each operand.  If set to NULL, duplicate tree nodes
4716      will be visited more than once.  */
4717   struct pointer_set_t *pset;
4718
4719   /* Indicates whether the operand being examined may be replaced
4720      with something that matches is_gimple_val (if true) or something
4721      slightly more complicated (if false).  "Something" technically
4722      means the common subset of is_gimple_lvalue and is_gimple_rhs,
4723      but we never try to form anything more complicated than that, so
4724      we don't bother checking.
4725
4726      Also note that CALLBACK should update this flag while walking the
4727      sub-expressions of a statement.  For instance, when walking the
4728      statement 'foo (&var)', the flag VAL_ONLY will initially be set
4729      to true, however, when walking &var, the operand of that
4730      ADDR_EXPR does not need to be a GIMPLE value.  */
4731   bool val_only;
4732
4733   /* True if we are currently walking the LHS of an assignment.  */
4734   bool is_lhs;
4735
4736   /* Optional.  Set to true by the callback functions if they made any
4737      changes.  */
4738   bool changed;
4739
4740   /* True if we're interested in location information.  */
4741   bool want_locations;
4742
4743   /* Operand returned by the callbacks.  This is set when calling
4744      walk_gimple_seq.  If the walk_stmt_fn or walk_tree_fn callback
4745      returns non-NULL, this field will contain the tree returned by
4746      the last callback.  */
4747   tree callback_result;
4748 };
4749
4750 /* Callback for walk_gimple_stmt.  Called for every statement found
4751    during traversal.  The first argument points to the statement to
4752    walk.  The second argument is a flag that the callback sets to
4753    'true' if it the callback handled all the operands and
4754    sub-statements of the statement (the default value of this flag is
4755    'false').  The third argument is an anonymous pointer to data
4756    to be used by the callback.  */
4757 typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
4758                               struct walk_stmt_info *);
4759
4760 gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
4761                         struct walk_stmt_info *);
4762 tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
4763                        struct walk_stmt_info *);
4764 tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
4765
4766 #ifdef GATHER_STATISTICS
4767 /* Enum and arrays used for allocation stats.  Keep in sync with
4768    gimple.c:gimple_alloc_kind_names.  */
4769 enum gimple_alloc_kind
4770 {
4771   gimple_alloc_kind_assign,     /* Assignments.  */
4772   gimple_alloc_kind_phi,        /* PHI nodes.  */
4773   gimple_alloc_kind_cond,       /* Conditionals.  */
4774   gimple_alloc_kind_seq,        /* Sequences.  */
4775   gimple_alloc_kind_rest,       /* Everything else.  */
4776   gimple_alloc_kind_all
4777 };
4778
4779 extern int gimple_alloc_counts[];
4780 extern int gimple_alloc_sizes[];
4781
4782 /* Return the allocation kind for a given stmt CODE.  */
4783 static inline enum gimple_alloc_kind
4784 gimple_alloc_kind (enum gimple_code code)
4785 {
4786   switch (code)
4787     {
4788       case GIMPLE_ASSIGN:
4789         return gimple_alloc_kind_assign;
4790       case GIMPLE_PHI:
4791         return gimple_alloc_kind_phi;
4792       case GIMPLE_COND:
4793         return gimple_alloc_kind_cond;
4794       default:
4795         return gimple_alloc_kind_rest;
4796     }
4797 }
4798 #endif /* GATHER_STATISTICS */
4799
4800 extern void dump_gimple_statistics (void);
4801
4802 /* In gimple-fold.c.  */
4803 void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
4804 tree gimple_fold_builtin (gimple);
4805 bool fold_stmt (gimple_stmt_iterator *);
4806 bool fold_stmt_inplace (gimple);
4807 tree maybe_fold_offset_to_reference (location_t, tree, tree, tree);
4808 tree maybe_fold_offset_to_address (location_t, tree, tree, tree);
4809 tree maybe_fold_stmt_addition (location_t, tree, tree, tree);
4810 tree get_symbol_constant_value (tree);
4811 bool may_propagate_address_into_dereference (tree, tree);
4812
4813
4814 #endif  /* GCC_GIMPLE_H */