1 /* This file contains the definitions and documentation for the common
2 tree codes used in the GNU C and C++ compilers (see c-common.def
3 for the standard codes).
4 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5 Written by Benjamin Chelf (chelf@codesourcery.com).
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING. If not, write to the Free
21 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 #include "coretypes.h"
30 #include "splay-tree.h"
42 #include "tree-inline.h"
44 /* If non-NULL, the address of a language-specific function for
45 expanding statements. */
46 void (*lang_expand_stmt
) PARAMS ((tree
));
48 /* If non-NULL, the address of a language-specific function for
49 expanding a DECL_STMT. After the language-independent cases are
50 handled, this function will be called. If this function is not
51 defined, it is assumed that declarations other than those for
52 variables and labels do not require any RTL generation. */
53 void (*lang_expand_decl_stmt
) PARAMS ((tree
));
55 static tree find_reachable_label_1
PARAMS ((tree
*, int *, void *));
56 static tree find_reachable_label
PARAMS ((tree
));
57 static bool expand_unreachable_if_stmt
PARAMS ((tree
));
58 static tree expand_unreachable_stmt
PARAMS ((tree
, int));
59 static void genrtl_do_stmt_1
PARAMS ((tree
, tree
));
61 /* Create an empty statement tree rooted at T. */
67 /* We create a trivial EXPR_STMT so that last_tree is never NULL in
68 what follows. We remove the extraneous statement in
70 *t
= build_nt (EXPR_STMT
, void_zero_node
);
72 last_expr_type
= NULL_TREE
;
73 last_expr_filename
= input_filename
;
76 /* T is a statement. Add it to the statement-tree. */
82 if (input_filename
!= last_expr_filename
)
84 /* If the filename has changed, also add in a FILE_STMT. Do a string
85 compare first, though, as it might be an equivalent string. */
86 int add
= (strcmp (input_filename
, last_expr_filename
) != 0);
87 last_expr_filename
= input_filename
;
90 tree pos
= build_nt (FILE_STMT
, get_identifier (input_filename
));
95 /* Add T to the statement-tree. */
96 TREE_CHAIN (last_tree
) = t
;
99 /* When we expand a statement-tree, we must know whether or not the
100 statements are full-expressions. We record that fact here. */
101 STMT_IS_FULL_EXPR_P (last_tree
) = stmts_are_full_exprs_p ();
103 /* Keep track of the number of statements in this function. */
104 if (current_function_decl
)
105 ++DECL_NUM_STMTS (current_function_decl
);
110 /* Create a declaration statement for the declaration given by the
119 /* We need the type to last until instantiation time. */
120 decl_stmt
= build_stmt (DECL_STMT
, decl
);
121 add_stmt (decl_stmt
);
124 /* Add a scope-statement to the statement-tree. BEGIN_P indicates
125 whether this statements opens or closes a scope. PARTIAL_P is true
126 for a partial scope, i.e, the scope that begins after a label when
127 an object that needs a cleanup is created. If BEGIN_P is nonzero,
128 returns a new TREE_LIST representing the top of the SCOPE_STMT
129 stack. The TREE_PURPOSE is the new SCOPE_STMT. If BEGIN_P is
130 zero, returns a TREE_LIST whose TREE_VALUE is the new SCOPE_STMT,
131 and whose TREE_PURPOSE is the matching SCOPE_STMT with
132 SCOPE_BEGIN_P set. */
135 add_scope_stmt (begin_p
, partial_p
)
139 tree
*stack_ptr
= current_scope_stmt_stack ();
141 tree top
= *stack_ptr
;
143 /* Build the statement. */
144 ss
= build_stmt (SCOPE_STMT
, NULL_TREE
);
145 SCOPE_BEGIN_P (ss
) = begin_p
;
146 SCOPE_PARTIAL_P (ss
) = partial_p
;
148 /* Keep the scope stack up to date. */
151 top
= tree_cons (ss
, NULL_TREE
, top
);
156 if (partial_p
!= SCOPE_PARTIAL_P (TREE_PURPOSE (top
)))
158 TREE_VALUE (top
) = ss
;
159 *stack_ptr
= TREE_CHAIN (top
);
162 /* Add the new statement to the statement-tree. */
168 /* Finish the statement tree rooted at T. */
176 /* Remove the fake extra statement added in begin_stmt_tree. */
177 stmt
= TREE_CHAIN (*t
);
179 last_tree
= NULL_TREE
;
183 /* The line-number recorded in the outermost statement in a function
184 is the line number of the end of the function. */
185 STMT_LINENO (stmt
) = input_line
;
186 STMT_LINENO_FOR_FN_P (stmt
) = 1;
190 /* Build a generic statement based on the given type of node and
191 arguments. Similar to `build_nt', except that we set
192 STMT_LINENO to be the current line number. */
193 /* ??? This should be obsolete with the lineno_stmt productions
197 build_stmt (enum tree_code code
, ...)
206 t
= make_node (code
);
207 length
= TREE_CODE_LENGTH (code
);
208 STMT_LINENO (t
) = input_line
;
210 for (i
= 0; i
< length
; i
++)
211 TREE_OPERAND (t
, i
) = va_arg (p
, tree
);
217 /* Some statements, like for-statements or if-statements, require a
218 condition. This condition can be a declaration. If T is such a
219 declaration it is processed, and an expression appropriate to use
220 as the condition is returned. Otherwise, T itself is returned. */
226 if (t
&& TREE_CODE (t
) == TREE_LIST
)
228 expand_stmt (TREE_PURPOSE (t
));
229 return TREE_VALUE (t
);
235 /* Create RTL for the local static variable DECL. */
238 make_rtl_for_local_static (decl
)
241 const char *asmspec
= NULL
;
243 /* If we inlined this variable, we could see it's declaration
245 if (TREE_ASM_WRITTEN (decl
))
248 /* If the DECL_ASSEMBLER_NAME is not the same as the DECL_NAME, then
249 either we already created RTL for this DECL (and since it was a
250 local variable, its DECL_ASSEMBLER_NAME got hacked up to prevent
251 clashes with other local statics with the same name by a previous
252 call to make_decl_rtl), or the user explicitly requested a
253 particular assembly name for this variable, using the GNU
254 extension for this purpose:
258 There's no way to know which case we're in, here. But, it turns
259 out we're safe. If there's already RTL, then
260 rest_of_decl_compilation ignores the ASMSPEC parameter, so we
261 may as well not pass it in. If there isn't RTL, then we didn't
262 already create RTL, which means that the modification to
263 DECL_ASSEMBLER_NAME came only via the explicit extension. */
264 if (DECL_ASSEMBLER_NAME (decl
) != DECL_NAME (decl
)
265 && !DECL_RTL_SET_P (decl
))
266 asmspec
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
));
268 rest_of_decl_compilation (decl
, asmspec
, /*top_level=*/0, /*at_end=*/0);
271 /* Let the back-end know about DECL. */
274 emit_local_var (decl
)
277 /* Create RTL for this variable. */
278 if (!DECL_RTL_SET_P (decl
))
280 if (DECL_C_HARD_REGISTER (decl
))
281 /* The user specified an assembler name for this variable.
283 rest_of_decl_compilation
284 (decl
, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl
)),
285 /*top_level=*/0, /*at_end=*/0);
290 if (DECL_INITIAL (decl
))
292 /* Actually do the initialization. */
293 if (stmts_are_full_exprs_p ())
294 expand_start_target_temps ();
296 expand_decl_init (decl
);
298 if (stmts_are_full_exprs_p ())
299 expand_end_target_temps ();
303 /* Helper for generating the RTL at the beginning of a scope. */
306 genrtl_do_pushlevel ()
308 emit_line_note (input_filename
, input_line
);
312 /* Generate the RTL for DESTINATION, which is a GOTO_STMT. */
315 genrtl_goto_stmt (destination
)
318 if (TREE_CODE (destination
) == IDENTIFIER_NODE
)
321 /* We warn about unused labels with -Wunused. That means we have to
322 mark the used labels as used. */
323 if (TREE_CODE (destination
) == LABEL_DECL
)
324 TREE_USED (destination
) = 1;
326 emit_line_note (input_filename
, input_line
);
328 if (TREE_CODE (destination
) == LABEL_DECL
)
330 label_rtx (destination
);
331 expand_goto (destination
);
334 expand_computed_goto (destination
);
337 /* Generate the RTL for EXPR, which is an EXPR_STMT. Provided just
338 for backward compatibility. genrtl_expr_stmt_value() should be
339 used for new code. */
342 genrtl_expr_stmt (expr
)
345 genrtl_expr_stmt_value (expr
, -1, 1);
348 /* Generate the RTL for EXPR, which is an EXPR_STMT. WANT_VALUE tells
349 whether to (1) save the value of the expression, (0) discard it or
350 (-1) use expr_stmts_for_value to tell. The use of -1 is
351 deprecated, and retained only for backward compatibility.
352 MAYBE_LAST is nonzero if this EXPR_STMT might be the last statement
353 in expression statement. */
356 genrtl_expr_stmt_value (expr
, want_value
, maybe_last
)
358 int want_value
, maybe_last
;
360 if (expr
!= NULL_TREE
)
362 emit_line_note (input_filename
, input_line
);
364 if (stmts_are_full_exprs_p ())
365 expand_start_target_temps ();
367 if (expr
!= error_mark_node
)
368 expand_expr_stmt_value (expr
, want_value
, maybe_last
);
370 if (stmts_are_full_exprs_p ())
371 expand_end_target_temps ();
375 /* Generate the RTL for T, which is a DECL_STMT. */
382 emit_line_note (input_filename
, input_line
);
383 decl
= DECL_STMT_DECL (t
);
384 /* If this is a declaration for an automatic local
385 variable, initialize it. Note that we might also see a
386 declaration for a namespace-scope object (declared with
387 `extern'). We don't have to handle the initialization
388 of those objects here; they can only be declarations,
389 rather than definitions. */
390 if (TREE_CODE (decl
) == VAR_DECL
391 && !TREE_STATIC (decl
)
392 && !DECL_EXTERNAL (decl
))
394 /* Let the back-end know about this variable. */
395 if (!anon_aggr_type_p (TREE_TYPE (decl
)))
396 emit_local_var (decl
);
398 expand_anon_union_decl (decl
, NULL_TREE
,
399 DECL_ANON_UNION_ELEMS (decl
));
401 else if (TREE_CODE (decl
) == VAR_DECL
&& TREE_STATIC (decl
))
402 make_rtl_for_local_static (decl
);
403 else if (TREE_CODE (decl
) == LABEL_DECL
404 && C_DECLARED_LABEL_FLAG (decl
))
405 declare_nonlocal_label (decl
);
406 else if (lang_expand_decl_stmt
)
407 (*lang_expand_decl_stmt
) (t
);
410 /* Generate the RTL for T, which is an IF_STMT. */
417 genrtl_do_pushlevel ();
418 cond
= expand_cond (IF_COND (t
));
419 emit_line_note (input_filename
, input_line
);
420 expand_start_cond (cond
, 0);
423 tree nextt
= THEN_CLAUSE (t
);
425 if (cond
&& integer_zerop (cond
))
426 nextt
= expand_unreachable_stmt (nextt
, warn_notreached
);
432 tree nextt
= ELSE_CLAUSE (t
);
433 expand_start_else ();
434 if (cond
&& integer_nonzerop (cond
))
435 nextt
= expand_unreachable_stmt (nextt
, warn_notreached
);
441 /* Generate the RTL for T, which is a WHILE_STMT. */
444 genrtl_while_stmt (t
)
447 tree cond
= WHILE_COND (t
);
450 emit_line_note (input_filename
, input_line
);
451 expand_start_loop (1);
452 genrtl_do_pushlevel ();
454 if (cond
&& !integer_nonzerop (cond
))
456 cond
= expand_cond (cond
);
457 emit_line_note (input_filename
, input_line
);
458 expand_exit_loop_top_cond (0, cond
);
459 genrtl_do_pushlevel ();
462 expand_stmt (WHILE_BODY (t
));
467 /* Generate the RTL for a DO_STMT with condition COND and loop BODY
468 body. This is reused for expanding unreachable WHILE_STMTS. */
471 genrtl_do_stmt_1 (cond
, body
)
474 /* Recognize the common special-case of do { ... } while (0) and do
475 not emit the loop widgetry in this case. In particular this
476 avoids cluttering the rtl with dummy loop notes, which can affect
477 alignment of adjacent labels. COND can be NULL due to parse
479 if (!cond
|| integer_zerop (cond
))
481 expand_start_null_loop ();
483 expand_end_null_loop ();
485 else if (integer_nonzerop (cond
))
488 emit_line_note (input_filename
, input_line
);
489 expand_start_loop (1);
493 emit_line_note (input_filename
, input_line
);
499 emit_line_note (input_filename
, input_line
);
500 expand_start_loop_continue_elsewhere (1);
504 expand_loop_continue_here ();
505 cond
= expand_cond (cond
);
506 emit_line_note (input_filename
, input_line
);
507 expand_exit_loop_if_false (0, cond
);
512 /* Generate the RTL for T, which is a DO_STMT. */
518 genrtl_do_stmt_1 (DO_COND (t
), DO_BODY (t
));
521 /* Build the node for a return statement and return it. */
524 build_return_stmt (expr
)
527 return (build_stmt (RETURN_STMT
, expr
));
530 /* Generate the RTL for STMT, which is a RETURN_STMT. */
533 genrtl_return_stmt (stmt
)
538 expr
= RETURN_STMT_EXPR (stmt
);
540 emit_line_note (input_filename
, input_line
);
542 expand_null_return ();
545 expand_start_target_temps ();
546 expand_return (expr
);
547 expand_end_target_temps ();
551 /* Generate the RTL for T, which is a FOR_STMT. */
557 tree cond
= FOR_COND (t
);
558 location_t saved_loc
;
560 if (NEW_FOR_SCOPE_P (t
))
561 genrtl_do_pushlevel ();
563 expand_stmt (FOR_INIT_STMT (t
));
565 /* Expand the initialization. */
567 emit_line_note (input_filename
, input_line
);
569 expand_start_loop_continue_elsewhere (1);
571 expand_start_loop (1);
572 genrtl_do_pushlevel ();
574 /* Save the filename and line number so that we expand the FOR_EXPR
575 we can reset them back to the saved values. */
576 saved_loc
= input_location
;
578 /* Expand the condition. */
579 if (cond
&& !integer_nonzerop (cond
))
581 cond
= expand_cond (cond
);
582 emit_line_note (input_filename
, input_line
);
583 expand_exit_loop_top_cond (0, cond
);
584 genrtl_do_pushlevel ();
587 /* Expand the body. */
588 expand_stmt (FOR_BODY (t
));
590 /* Expand the increment expression. */
591 input_location
= saved_loc
;
592 emit_line_note (input_filename
, input_line
);
595 expand_loop_continue_here ();
596 genrtl_expr_stmt (FOR_EXPR (t
));
601 /* Build a break statement node and return it. */
606 return (build_stmt (BREAK_STMT
));
609 /* Generate the RTL for a BREAK_STMT. */
614 emit_line_note (input_filename
, input_line
);
615 if ( ! expand_exit_something ())
616 error ("break statement not within loop or switch");
619 /* Build a continue statement node and return it. */
622 build_continue_stmt ()
624 return (build_stmt (CONTINUE_STMT
));
627 /* Generate the RTL for a CONTINUE_STMT. */
630 genrtl_continue_stmt ()
632 emit_line_note (input_filename
, input_line
);
633 if (! expand_continue_loop (0))
634 error ("continue statement not within a loop");
637 /* Generate the RTL for T, which is a SCOPE_STMT. */
640 genrtl_scope_stmt (t
)
643 tree block
= SCOPE_STMT_BLOCK (t
);
645 if (!SCOPE_NO_CLEANUPS_P (t
))
647 if (SCOPE_BEGIN_P (t
))
648 expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t
), block
);
649 else if (SCOPE_END_P (t
))
650 expand_end_bindings (NULL_TREE
, !SCOPE_NULLIFIED_P (t
), 0);
652 else if (!SCOPE_NULLIFIED_P (t
))
654 rtx note
= emit_note (NULL
,
656 ? NOTE_INSN_BLOCK_BEG
657 : NOTE_INSN_BLOCK_END
));
658 NOTE_BLOCK (note
) = block
;
661 /* If we're at the end of a scope that contains inlined nested
662 functions, we have to decide whether or not to write them out. */
663 if (block
&& SCOPE_END_P (t
))
667 for (fn
= BLOCK_VARS (block
); fn
; fn
= TREE_CHAIN (fn
))
669 if (TREE_CODE (fn
) == FUNCTION_DECL
670 && DECL_CONTEXT (fn
) == current_function_decl
671 && DECL_SAVED_INSNS (fn
)
672 && !TREE_ASM_WRITTEN (fn
)
673 && TREE_ADDRESSABLE (fn
))
675 push_function_context ();
676 output_inline_function (fn
);
677 pop_function_context ();
683 /* Generate the RTL for T, which is a SWITCH_STMT. */
686 genrtl_switch_stmt (t
)
690 genrtl_do_pushlevel ();
692 cond
= expand_cond (SWITCH_COND (t
));
693 if (cond
== error_mark_node
)
694 /* The code is in error, but we don't want expand_end_case to
696 cond
= boolean_false_node
;
698 emit_line_note (input_filename
, input_line
);
699 expand_start_case (1, cond
, TREE_TYPE (cond
), "switch statement");
700 expand_stmt (expand_unreachable_stmt (SWITCH_BODY (t
), warn_notreached
));
701 expand_end_case_type (cond
, SWITCH_TYPE (t
));
704 /* Create a CASE_LABEL tree node and return it. */
707 build_case_label (low_value
, high_value
, label_decl
)
712 return build_stmt (CASE_LABEL
, low_value
, high_value
, label_decl
);
716 /* Generate the RTL for a CASE_LABEL. */
719 genrtl_case_label (case_label
)
725 cleanup
= last_cleanup_this_contour ();
728 static int explained
= 0;
729 warning ("destructor needed for `%#D'", (TREE_PURPOSE (cleanup
)));
730 warning ("where case label appears here");
733 warning ("(enclose actions of previous case statements requiring destructors in their own scope.)");
738 add_case_node (CASE_LOW (case_label
), CASE_HIGH (case_label
),
739 CASE_LABEL_DECL (case_label
), &duplicate
);
742 /* Generate the RTL for T, which is a COMPOUND_STMT. */
745 genrtl_compound_stmt (t
)
748 #ifdef ENABLE_CHECKING
749 struct nesting
*n
= current_nesting_level ();
752 expand_stmt (COMPOUND_BODY (t
));
754 #ifdef ENABLE_CHECKING
755 /* Make sure that we've pushed and popped the same number of levels. */
756 if (!COMPOUND_STMT_NO_SCOPE (t
) && n
!= current_nesting_level ())
761 /* Generate the RTL for an ASM_STMT. */
764 genrtl_asm_stmt (cv_qualifier
, string
, output_operands
,
765 input_operands
, clobbers
, asm_input_p
)
768 tree output_operands
;
773 if (cv_qualifier
!= NULL_TREE
774 && cv_qualifier
!= ridpointers
[(int) RID_VOLATILE
])
776 warning ("%s qualifier ignored on asm",
777 IDENTIFIER_POINTER (cv_qualifier
));
778 cv_qualifier
= NULL_TREE
;
781 emit_line_note (input_filename
, input_line
);
783 expand_asm (string
, cv_qualifier
!= NULL_TREE
);
785 c_expand_asm_operands (string
, output_operands
, input_operands
,
786 clobbers
, cv_qualifier
!= NULL_TREE
,
787 input_filename
, input_line
);
790 /* Generate the RTL for a CLEANUP_STMT. */
793 genrtl_cleanup_stmt (t
)
796 tree decl
= CLEANUP_DECL (t
);
797 if (!decl
|| (DECL_SIZE (decl
) && TREE_TYPE (decl
) != error_mark_node
))
798 expand_decl_cleanup_eh (decl
, CLEANUP_EXPR (t
), CLEANUP_EH_ONLY (t
));
801 /* We're about to expand T, a statement. Set up appropriate context
802 for the substitution. */
808 if (!STMT_LINENO_FOR_FN_P (t
))
809 input_line
= STMT_LINENO (t
);
810 current_stmt_tree ()->stmts_are_full_exprs_p
= STMT_IS_FULL_EXPR_P (t
);
813 /* Generate the RTL for the statement T, its substatements, and any
814 other statements at its nesting level. */
820 while (t
&& t
!= error_mark_node
)
822 int saved_stmts_are_full_exprs_p
;
824 /* Set up context appropriately for handling this statement. */
825 saved_stmts_are_full_exprs_p
= stmts_are_full_exprs_p ();
828 switch (TREE_CODE (t
))
831 input_filename
= FILE_STMT_FILENAME (t
);
835 genrtl_return_stmt (t
);
836 t
= expand_unreachable_stmt (TREE_CHAIN (t
), warn_notreached
);
840 genrtl_expr_stmt_value (EXPR_STMT_EXPR (t
), TREE_ADDRESSABLE (t
),
841 TREE_CHAIN (t
) == NULL
842 || (TREE_CODE (TREE_CHAIN (t
)) == SCOPE_STMT
843 && TREE_CHAIN (TREE_CHAIN (t
)) == NULL
));
847 genrtl_decl_stmt (t
);
855 genrtl_while_stmt (t
);
867 genrtl_compound_stmt (t
);
871 genrtl_break_stmt ();
872 t
= expand_unreachable_stmt (TREE_CHAIN (t
), warn_notreached
);
876 genrtl_continue_stmt ();
877 t
= expand_unreachable_stmt (TREE_CHAIN (t
), warn_notreached
);
881 genrtl_switch_stmt (t
);
885 genrtl_case_label (t
);
889 expand_label (LABEL_STMT_LABEL (t
));
893 /* Emit information for branch prediction. */
895 && TREE_CODE (GOTO_DESTINATION (t
)) == LABEL_DECL
896 && flag_guess_branch_prob
)
898 rtx note
= emit_note (NULL
, NOTE_INSN_PREDICTION
);
900 NOTE_PREDICTION (note
) = NOTE_PREDICT (PRED_GOTO
, NOT_TAKEN
);
902 genrtl_goto_stmt (GOTO_DESTINATION (t
));
903 t
= expand_unreachable_stmt (TREE_CHAIN (t
), warn_notreached
);
907 genrtl_asm_stmt (ASM_CV_QUAL (t
), ASM_STRING (t
),
908 ASM_OUTPUTS (t
), ASM_INPUTS (t
),
909 ASM_CLOBBERS (t
), ASM_INPUT_P (t
));
913 genrtl_scope_stmt (t
);
917 genrtl_cleanup_stmt (t
);
921 if (lang_expand_stmt
)
922 (*lang_expand_stmt
) (t
);
928 /* Go on to the next statement in this scope. */
932 /* Restore saved state. */
933 current_stmt_tree ()->stmts_are_full_exprs_p
934 = saved_stmts_are_full_exprs_p
;
938 /* If *TP is a potentially reachable label, return nonzero. */
941 find_reachable_label_1 (tp
, walk_subtrees
, data
)
943 int *walk_subtrees ATTRIBUTE_UNUSED
;
944 void *data ATTRIBUTE_UNUSED
;
946 switch (TREE_CODE (*tp
))
958 /* Determine whether expression EXP contains a potentially
961 find_reachable_label (exp
)
964 location_t saved_loc
= input_location
;
965 tree ret
= walk_tree (&exp
, find_reachable_label_1
, NULL
, NULL
);
966 input_location
= saved_loc
;
970 /* Expand an unreachable if statement, T. This function returns
971 true if the IF_STMT contains a potentially reachable code_label. */
973 expand_unreachable_if_stmt (t
)
978 if (find_reachable_label (IF_COND (t
)) != NULL_TREE
)
984 if (THEN_CLAUSE (t
) && ELSE_CLAUSE (t
))
986 n
= expand_unreachable_stmt (THEN_CLAUSE (t
), 0);
992 label
= gen_label_rtx ();
994 expand_stmt (expand_unreachable_stmt (ELSE_CLAUSE (t
), 0));
999 n
= expand_unreachable_stmt (ELSE_CLAUSE (t
), 0);
1001 else if (THEN_CLAUSE (t
))
1002 n
= expand_unreachable_stmt (THEN_CLAUSE (t
), 0);
1003 else if (ELSE_CLAUSE (t
))
1004 n
= expand_unreachable_stmt (ELSE_CLAUSE (t
), 0);
1010 return n
!= NULL_TREE
;
1013 /* Expand an unreachable statement list. This function skips all
1014 statements preceding the first potentially reachable label and
1015 then returns the label (or, in same cases, the statement after
1016 one containing the label). */
1018 expand_unreachable_stmt (t
, warn
)
1024 while (t
&& t
!= error_mark_node
)
1027 switch (TREE_CODE (t
))
1035 if (!STMT_LINENO_FOR_FN_P (t
))
1036 input_line
= STMT_LINENO (t
);
1037 warning("will never be executed");
1045 switch (TREE_CODE (t
))
1053 input_filename
= FILE_STMT_FILENAME (t
);
1057 if (find_reachable_label (RETURN_STMT_EXPR (t
)) != NULL_TREE
)
1062 if (find_reachable_label (EXPR_STMT_EXPR (t
)) != NULL_TREE
)
1067 if (expand_unreachable_if_stmt (t
))
1068 return TREE_CHAIN (t
);
1072 /* If the start of a while statement is unreachable, there is
1073 no need to rotate the loop, instead the WHILE_STMT can be
1074 expanded like a DO_STMT. */
1075 genrtl_do_stmt_1 (WHILE_COND (t
), WHILE_BODY (t
));
1076 return TREE_CHAIN (t
);
1081 n
= expand_unreachable_stmt (COMPOUND_BODY (t
), warn
);
1085 return TREE_CHAIN (t
);
1092 saved
= stmts_are_full_exprs_p ();
1094 genrtl_scope_stmt (t
);
1095 current_stmt_tree ()->stmts_are_full_exprs_p
= saved
;