OSDN Git Service

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