OSDN Git Service

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