OSDN Git Service

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