OSDN Git Service

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