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