OSDN Git Service

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