OSDN Git Service

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