OSDN Git Service

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