OSDN Git Service

* tree.h (expand_expr_stmt_value): Add maybe_last argument.
[pf3gnuchains/gcc-fork.git] / gcc / c-semantics.c
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 Free Software Foundation, Inc.
5    Written by Benjamin Chelf (chelf@codesourcery.com).
6
7 This file is part of GCC.
8
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
12 version.
13
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
17 for more details.
18
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
22 02111-1307, USA.  */
23
24 #include "config.h"
25 #include "system.h"
26 #include "tree.h"
27 #include "function.h"
28 #include "splay-tree.h"
29 #include "varray.h"
30 #include "c-common.h"
31 #include "except.h"
32 #include "toplev.h"
33 #include "flags.h"
34 #include "ggc.h"
35 #include "rtl.h"
36 #include "expr.h"
37 #include "output.h"
38 #include "timevar.h"
39
40 /* If non-NULL, the address of a language-specific function for
41    expanding statements.  */
42 void (*lang_expand_stmt) PARAMS ((tree));
43
44 /* If non-NULL, the address of a language-specific function for
45    expanding a DECL_STMT.  After the language-independent cases are
46    handled, this function will be called.  If this function is not
47    defined, it is assumed that declarations other than those for
48    variables and labels do not require any RTL generation.  */
49 void (*lang_expand_decl_stmt) PARAMS ((tree));
50
51 /* Create an empty statement tree rooted at T.  */
52
53 void
54 begin_stmt_tree (t)
55      tree *t;
56 {
57   /* We create a trivial EXPR_STMT so that last_tree is never NULL in
58      what follows.  We remove the extraneous statement in
59      finish_stmt_tree.  */
60   *t = build_nt (EXPR_STMT, void_zero_node);
61   last_tree = *t;
62   last_expr_type = NULL_TREE;
63 }
64
65 /* T is a statement.  Add it to the statement-tree.  */
66
67 tree
68 add_stmt (t)
69      tree t;
70 {
71   /* Add T to the statement-tree.  */
72   TREE_CHAIN (last_tree) = t;
73   last_tree = t;
74   
75   /* When we expand a statement-tree, we must know whether or not the
76      statements are full-expressions.  We record that fact here.  */
77   STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p ();
78
79   /* Keep track of the number of statements in this function.  */
80   if (current_function_decl)
81     ++DECL_NUM_STMTS (current_function_decl);
82
83   return t;
84 }
85
86 /* Create a declaration statement for the declaration given by the
87    DECL.  */
88
89 void
90 add_decl_stmt (decl)
91      tree decl;
92 {
93   tree decl_stmt;
94
95   /* We need the type to last until instantiation time.  */
96   decl_stmt = build_stmt (DECL_STMT, decl);
97   add_stmt (decl_stmt); 
98 }
99
100 /* Add a scope-statement to the statement-tree.  BEGIN_P indicates
101    whether this statements opens or closes a scope.  PARTIAL_P is true
102    for a partial scope, i.e, the scope that begins after a label when
103    an object that needs a cleanup is created.  If BEGIN_P is nonzero,
104    returns a new TREE_LIST representing the top of the SCOPE_STMT
105    stack.  The TREE_PURPOSE is the new SCOPE_STMT.  If BEGIN_P is
106    zero, returns a TREE_LIST whose TREE_VALUE is the new SCOPE_STMT,
107    and whose TREE_PURPOSE is the matching SCOPE_STMT with
108    SCOPE_BEGIN_P set.  */
109
110 tree
111 add_scope_stmt (begin_p, partial_p)
112      int begin_p;
113      int partial_p;
114 {
115   tree *stack_ptr = current_scope_stmt_stack ();
116   tree ss;
117   tree top = *stack_ptr;
118
119   /* Build the statement.  */
120   ss = build_stmt (SCOPE_STMT, NULL_TREE);
121   SCOPE_BEGIN_P (ss) = begin_p;
122   SCOPE_PARTIAL_P (ss) = partial_p;
123
124   /* Keep the scope stack up to date.  */
125   if (begin_p)
126     {
127       top = tree_cons (ss, NULL_TREE, top);
128       *stack_ptr = top;
129     }
130   else
131     {
132       TREE_VALUE (top) = ss;
133       *stack_ptr = TREE_CHAIN (top);
134     }
135
136   /* Add the new statement to the statement-tree.  */
137   add_stmt (ss);
138
139   return top;
140 }
141
142 /* Finish the statement tree rooted at T.  */
143
144 void
145 finish_stmt_tree (t)
146      tree *t;
147 {
148   tree stmt;
149   
150   /* Remove the fake extra statement added in begin_stmt_tree.  */
151   stmt = TREE_CHAIN (*t);
152   *t = stmt;
153   last_tree = NULL_TREE;
154
155   if (cfun && stmt)
156     {
157       /* The line-number recorded in the outermost statement in a function
158          is the line number of the end of the function.  */
159       STMT_LINENO (stmt) = lineno;
160       STMT_LINENO_FOR_FN_P (stmt) = 1;
161     }
162 }
163
164 /* Build a generic statement based on the given type of node and
165    arguments. Similar to `build_nt', except that we set
166    STMT_LINENO to be the current line number.  */
167 /* ??? This should be obsolete with the lineno_stmt productions
168    in the grammar.  */
169
170 tree
171 build_stmt VPARAMS ((enum tree_code code, ...))
172 {
173   tree t;
174   int length;
175   int i;
176
177   VA_OPEN (p, code);
178   VA_FIXEDARG (p, enum tree_code, code);
179
180   t = make_node (code);
181   length = TREE_CODE_LENGTH (code);
182   STMT_LINENO (t) = lineno;
183
184   for (i = 0; i < length; i++)
185     TREE_OPERAND (t, i) = va_arg (p, tree);
186
187   VA_CLOSE (p);
188   return t;
189 }
190
191 /* Some statements, like for-statements or if-statements, require a
192    condition.  This condition can be a declaration.  If T is such a
193    declaration it is processed, and an expression appropriate to use
194    as the condition is returned.  Otherwise, T itself is returned.  */
195
196 tree
197 expand_cond (t)
198      tree t;
199 {
200   if (t && TREE_CODE (t) == TREE_LIST)
201     {
202       expand_stmt (TREE_PURPOSE (t));
203       return TREE_VALUE (t);
204     }
205   else 
206     return t;
207 }
208
209 /* Create RTL for the local static variable DECL.  */
210
211 void
212 make_rtl_for_local_static (decl)
213      tree decl;
214 {
215   const char *asmspec = NULL;
216
217   /* If we inlined this variable, we could see it's declaration
218      again.  */
219   if (TREE_ASM_WRITTEN (decl))
220     return;
221
222   /* If the DECL_ASSEMBLER_NAME is not the same as the DECL_NAME, then
223      either we already created RTL for this DECL (and since it was a
224      local variable, its DECL_ASSEMBLER_NAME got hacked up to prevent
225      clashes with other local statics with the same name by a previous
226      call to make_decl_rtl), or the user explicitly requested a
227      particular assembly name for this variable, using the GNU
228      extension for this purpose:
229
230        int i asm ("j");
231
232      There's no way to know which case we're in, here.  But, it turns
233      out we're safe.  If there's already RTL, then
234      rest_of_decl_compilation ignores the ASMSPEC parameter, so we
235      may as well not pass it in.  If there isn't RTL, then we didn't
236      already create RTL, which means that the modification to
237      DECL_ASSEMBLER_NAME came only via the explicit extension.  */
238   if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
239       && !DECL_RTL_SET_P (decl))
240     asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
241
242   rest_of_decl_compilation (decl, asmspec, /*top_level=*/0, /*at_end=*/0);
243 }
244
245 /* Let the back-end know about DECL.  */
246
247 void
248 emit_local_var (decl)
249      tree decl;
250 {
251   /* Create RTL for this variable.  */
252   if (!DECL_RTL_SET_P (decl))
253     {
254       if (DECL_C_HARD_REGISTER (decl))
255         /* The user specified an assembler name for this variable.
256            Set that up now.  */
257         rest_of_decl_compilation
258           (decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
259            /*top_level=*/0, /*at_end=*/0);
260       else
261         expand_decl (decl);
262     }
263
264   /* Actually do the initialization.  */
265   if (stmts_are_full_exprs_p ())
266     expand_start_target_temps ();
267
268   expand_decl_init (decl);
269
270   if (stmts_are_full_exprs_p ())
271     expand_end_target_temps ();
272 }
273
274 /* Helper for generating the RTL at the beginning of a scope.  */
275
276 void
277 genrtl_do_pushlevel ()
278 {
279   emit_line_note (input_filename, lineno);
280   clear_last_expr ();
281 }
282
283 /* Generate the RTL for DESTINATION, which is a GOTO_STMT.  */
284
285 void
286 genrtl_goto_stmt (destination)
287      tree destination;
288 {
289   if (TREE_CODE (destination) == IDENTIFIER_NODE)
290     abort ();
291   
292   /* We warn about unused labels with -Wunused.  That means we have to
293      mark the used labels as used.  */
294   if (TREE_CODE (destination) == LABEL_DECL)
295     TREE_USED (destination) = 1;
296   
297   emit_line_note (input_filename, lineno);
298   
299   if (TREE_CODE (destination) == LABEL_DECL)
300     {
301       label_rtx (destination);
302       expand_goto (destination); 
303     }
304   else
305     expand_computed_goto (destination);
306 }
307
308 /* Generate the RTL for EXPR, which is an EXPR_STMT.  Provided just
309    for backward compatibility.  genrtl_expr_stmt_value() should be
310    used for new code.  */
311
312 void
313 genrtl_expr_stmt (expr)
314      tree expr;
315 {
316   genrtl_expr_stmt_value (expr, -1, 1);
317 }
318
319 /* Generate the RTL for EXPR, which is an EXPR_STMT.  WANT_VALUE tells
320    whether to (1) save the value of the expression, (0) discard it or
321    (-1) use expr_stmts_for_value to tell.  The use of -1 is
322    deprecated, and retained only for backward compatibility.
323    MAYBE_LAST is non-zero if this EXPR_STMT might be the last statement
324    in expression statement.  */
325
326 void 
327 genrtl_expr_stmt_value (expr, want_value, maybe_last)
328      tree expr;
329      int want_value, maybe_last;
330 {
331   if (expr != NULL_TREE)
332     {
333       emit_line_note (input_filename, lineno);
334       
335       if (stmts_are_full_exprs_p ())
336         expand_start_target_temps ();
337       
338       if (expr != error_mark_node)
339         expand_expr_stmt_value (expr, want_value, maybe_last);
340       
341       if (stmts_are_full_exprs_p ())
342         expand_end_target_temps ();
343     }
344 }
345
346 /* Generate the RTL for T, which is a DECL_STMT.  */
347
348 void
349 genrtl_decl_stmt (t)
350      tree t;
351 {
352   tree decl;
353   emit_line_note (input_filename, lineno);
354   decl = DECL_STMT_DECL (t);
355   /* If this is a declaration for an automatic local
356      variable, initialize it.  Note that we might also see a
357      declaration for a namespace-scope object (declared with
358      `extern').  We don't have to handle the initialization
359      of those objects here; they can only be declarations,
360      rather than definitions.  */
361   if (TREE_CODE (decl) == VAR_DECL 
362       && !TREE_STATIC (decl)
363       && !DECL_EXTERNAL (decl))
364     {
365       /* Let the back-end know about this variable.  */
366       if (!anon_aggr_type_p (TREE_TYPE (decl)))
367         emit_local_var (decl);
368       else
369         expand_anon_union_decl (decl, NULL_TREE, 
370                                 DECL_ANON_UNION_ELEMS (decl));
371     }
372   else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
373     make_rtl_for_local_static (decl);
374   else if (TREE_CODE (decl) == LABEL_DECL 
375            && C_DECLARED_LABEL_FLAG (decl))
376     declare_nonlocal_label (decl);
377   else if (lang_expand_decl_stmt)
378     (*lang_expand_decl_stmt) (t);
379 }
380
381 /* Generate the RTL for T, which is an IF_STMT.  */
382
383 void
384 genrtl_if_stmt (t)
385      tree t;
386 {
387   tree cond;
388   genrtl_do_pushlevel ();
389   cond = expand_cond (IF_COND (t));
390   emit_line_note (input_filename, lineno);
391   expand_start_cond (cond, 0);
392   if (THEN_CLAUSE (t))
393     expand_stmt (THEN_CLAUSE (t));
394   if (ELSE_CLAUSE (t))
395     {
396       expand_start_else ();
397       expand_stmt (ELSE_CLAUSE (t));
398     }
399   expand_end_cond ();
400 }
401
402 /* Generate the RTL for T, which is a WHILE_STMT.  */
403
404 void
405 genrtl_while_stmt (t)
406      tree t;
407 {
408   tree cond;
409   emit_nop ();
410   emit_line_note (input_filename, lineno);
411   expand_start_loop (1); 
412   genrtl_do_pushlevel ();
413
414   cond = expand_cond (WHILE_COND (t));
415   emit_line_note (input_filename, lineno);
416   expand_exit_loop_if_false (0, cond);
417   genrtl_do_pushlevel ();
418   
419   expand_stmt (WHILE_BODY (t));
420
421   expand_end_loop ();
422 }
423
424 /* Generate the RTL for T, which is a DO_STMT.  */
425
426 void
427 genrtl_do_stmt (t)
428      tree t;
429 {
430   tree cond = DO_COND (t);
431
432   /* Recognize the common special-case of do { ... } while (0) and do
433      not emit the loop widgetry in this case.  In particular this
434      avoids cluttering the rtl with dummy loop notes, which can affect
435      alignment of adjacent labels.  */
436   if (integer_zerop (cond))
437     {
438       expand_start_null_loop ();
439       expand_stmt (DO_BODY (t));
440       expand_end_null_loop ();
441     }
442   else
443     {
444       emit_nop ();
445       emit_line_note (input_filename, lineno);
446       expand_start_loop_continue_elsewhere (1);
447
448       expand_stmt (DO_BODY (t));
449
450       expand_loop_continue_here ();
451       cond = expand_cond (cond);
452       emit_line_note (input_filename, lineno);
453       expand_exit_loop_if_false (0, cond);
454       expand_end_loop ();
455     }
456 }
457
458 /* Build the node for a return statement and return it.  */
459
460 tree
461 build_return_stmt (expr)
462      tree expr;
463 {
464   return (build_stmt (RETURN_STMT, expr));
465 }
466
467 /* Generate the RTL for STMT, which is a RETURN_STMT.  */
468
469 void
470 genrtl_return_stmt (stmt)
471      tree stmt;
472 {
473   tree expr;
474
475   expr = RETURN_EXPR (stmt);
476
477   emit_line_note (input_filename, lineno);
478   if (!expr)
479     expand_null_return ();
480   else
481     {
482       expand_start_target_temps ();
483       expand_return (expr);
484       expand_end_target_temps ();
485     }
486 }
487
488 /* Generate the RTL for T, which is a FOR_STMT.  */
489
490 void
491 genrtl_for_stmt (t)
492      tree t;
493 {
494   tree cond;
495   const char *saved_filename;
496   int saved_lineno;
497
498   if (NEW_FOR_SCOPE_P (t))
499     genrtl_do_pushlevel ();
500
501   expand_stmt (FOR_INIT_STMT (t));
502
503   /* Expand the initialization.  */
504   emit_nop ();
505   emit_line_note (input_filename, lineno);
506   expand_start_loop_continue_elsewhere (1); 
507   genrtl_do_pushlevel ();
508   cond = expand_cond (FOR_COND (t));
509
510   /* Save the filename and line number so that we expand the FOR_EXPR
511      we can reset them back to the saved values.  */
512   saved_filename = input_filename;
513   saved_lineno = lineno;
514
515   /* Expand the condition.  */
516   emit_line_note (input_filename, lineno);
517   if (cond)
518     expand_exit_loop_if_false (0, cond);
519
520   /* Expand the body.  */
521   genrtl_do_pushlevel ();
522   expand_stmt (FOR_BODY (t));
523
524   /* Expand the increment expression.  */
525   input_filename = saved_filename;
526   lineno = saved_lineno;
527   emit_line_note (input_filename, lineno);
528   expand_loop_continue_here ();
529   if (FOR_EXPR (t))
530     genrtl_expr_stmt (FOR_EXPR (t));
531   expand_end_loop ();
532 }
533
534 /* Build a break statement node and return it.  */
535
536 tree
537 build_break_stmt ()
538 {
539   return (build_stmt (BREAK_STMT));
540 }
541
542 /* Generate the RTL for a BREAK_STMT.  */
543
544 void
545 genrtl_break_stmt ()
546 {
547   emit_line_note (input_filename, lineno);
548   if ( ! expand_exit_something ())
549     error ("break statement not within loop or switch");
550 }
551
552 /* Build a continue statement node and return it.  */
553
554 tree
555 build_continue_stmt ()
556 {
557   return (build_stmt (CONTINUE_STMT));
558 }
559
560 /* Generate the RTL for a CONTINUE_STMT.  */
561
562 void
563 genrtl_continue_stmt ()
564 {
565   emit_line_note (input_filename, lineno);
566   if (! expand_continue_loop (0))
567     error ("continue statement not within a loop");   
568 }
569
570 /* Generate the RTL for T, which is a SCOPE_STMT.  */
571
572 void
573 genrtl_scope_stmt (t)
574      tree t;
575 {
576   tree block = SCOPE_STMT_BLOCK (t);
577
578   if (!SCOPE_NO_CLEANUPS_P (t))
579     {
580       if (SCOPE_BEGIN_P (t))
581         expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t), block);
582       else if (SCOPE_END_P (t))
583         expand_end_bindings (NULL_TREE, !SCOPE_NULLIFIED_P (t), 0);
584     }
585   else if (!SCOPE_NULLIFIED_P (t))
586     {
587       rtx note = emit_note (NULL,
588                             (SCOPE_BEGIN_P (t) 
589                              ? NOTE_INSN_BLOCK_BEG
590                              : NOTE_INSN_BLOCK_END));
591       NOTE_BLOCK (note) = block;
592     }
593
594   /* If we're at the end of a scope that contains inlined nested
595      functions, we have to decide whether or not to write them out.  */
596   if (block && SCOPE_END_P (t))
597     {
598       tree fn;
599
600       for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn))
601         {
602           if (TREE_CODE (fn) == FUNCTION_DECL 
603               && DECL_CONTEXT (fn) == current_function_decl
604               && !TREE_ASM_WRITTEN (fn)
605               && TREE_ADDRESSABLE (fn))
606             {
607               push_function_context ();
608               output_inline_function (fn);
609               pop_function_context ();
610             }
611         }
612     }
613 }
614
615 /* Generate the RTL for T, which is a SWITCH_STMT.  */
616
617 void
618 genrtl_switch_stmt (t)
619      tree t;
620 {
621   tree cond;
622   genrtl_do_pushlevel ();
623  
624   cond = expand_cond (SWITCH_COND (t));
625   if (cond == error_mark_node)
626     /* The code is in error, but we don't want expand_end_case to
627        crash.  */
628     cond = boolean_false_node;
629
630   emit_line_note (input_filename, lineno);
631   expand_start_case (1, cond, TREE_TYPE (cond), "switch statement");
632   expand_stmt (SWITCH_BODY (t));
633   expand_end_case (cond);
634 }
635
636 /* Create a CASE_LABEL tree node and return it.  */
637
638 tree
639 build_case_label (low_value, high_value, label_decl)
640      tree low_value;
641      tree high_value;
642      tree label_decl;
643 {
644   return build_stmt (CASE_LABEL, low_value, high_value, label_decl);
645 }
646
647
648 /* Generate the RTL for a CASE_LABEL.  */
649
650 void 
651 genrtl_case_label (case_label)
652      tree case_label;
653 {
654   tree duplicate;
655   tree cleanup;
656
657   cleanup = last_cleanup_this_contour ();
658   if (cleanup)
659     {
660       static int explained = 0;
661       warning_with_decl (TREE_PURPOSE (cleanup), 
662                          "destructor needed for `%#D'");
663       warning ("where case label appears here");
664       if (!explained)
665         {
666           warning ("(enclose actions of previous case statements requiring destructors in their own scope.)");
667           explained = 1;
668         }
669     }
670
671   add_case_node (CASE_LOW (case_label), CASE_HIGH (case_label), 
672                  CASE_LABEL_DECL (case_label), &duplicate);
673 }
674
675 /* Generate the RTL for T, which is a COMPOUND_STMT.  */
676
677 void
678 genrtl_compound_stmt (t)
679     tree t;
680 {
681 #ifdef ENABLE_CHECKING
682   struct nesting *n = current_nesting_level ();
683 #endif
684
685   expand_stmt (COMPOUND_BODY (t));
686
687 #ifdef ENABLE_CHECKING
688   /* Make sure that we've pushed and popped the same number of levels.  */
689   if (n != current_nesting_level ())
690     abort ();
691 #endif
692 }
693
694 /* Generate the RTL for an ASM_STMT.  */
695
696 void
697 genrtl_asm_stmt (cv_qualifier, string, output_operands,
698                  input_operands, clobbers, asm_input_p)
699      tree cv_qualifier;
700      tree string;
701      tree output_operands;
702      tree input_operands;
703      tree clobbers;
704      int asm_input_p;
705 {
706   if (cv_qualifier != NULL_TREE
707       && cv_qualifier != ridpointers[(int) RID_VOLATILE])
708     {
709       warning ("%s qualifier ignored on asm",
710                IDENTIFIER_POINTER (cv_qualifier));
711       cv_qualifier = NULL_TREE;
712     }
713
714   emit_line_note (input_filename, lineno);
715   if (asm_input_p)
716     expand_asm (string);
717   else
718     c_expand_asm_operands (string, output_operands, input_operands, 
719                            clobbers, cv_qualifier != NULL_TREE,
720                            input_filename, lineno);
721 }
722
723 /* Generate the RTL for a DECL_CLEANUP.  */
724
725 void 
726 genrtl_decl_cleanup (decl, cleanup)
727      tree decl;
728      tree cleanup;
729 {
730   if (!decl || (DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node))
731     expand_decl_cleanup (decl, cleanup);
732 }
733
734 /* We're about to expand T, a statement.  Set up appropriate context
735    for the substitution.  */
736
737 void
738 prep_stmt (t)
739      tree t;
740 {
741   if (!STMT_LINENO_FOR_FN_P (t))
742     lineno = STMT_LINENO (t);
743   current_stmt_tree ()->stmts_are_full_exprs_p = STMT_IS_FULL_EXPR_P (t);
744 }
745
746 /* Generate the RTL for the statement T, its substatements, and any
747    other statements at its nesting level.  */
748
749 void
750 expand_stmt (t)
751      tree t;
752 {
753   while (t && t != error_mark_node)
754     {
755       int saved_stmts_are_full_exprs_p;
756
757       /* Set up context appropriately for handling this statement.  */
758       saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
759       prep_stmt (t);
760
761       switch (TREE_CODE (t))
762         {
763         case RETURN_STMT:
764           genrtl_return_stmt (t);
765           break;
766
767         case EXPR_STMT:
768           genrtl_expr_stmt_value (EXPR_STMT_EXPR (t), TREE_ADDRESSABLE (t),
769                                   TREE_CHAIN (t) == NULL
770                                   || (TREE_CODE (TREE_CHAIN (t)) == SCOPE_STMT
771                                       && TREE_CHAIN (TREE_CHAIN (t)) == NULL));
772           break;
773
774         case DECL_STMT:
775           genrtl_decl_stmt (t);
776           break;
777
778         case FOR_STMT:
779           genrtl_for_stmt (t);
780           break;
781
782         case WHILE_STMT:
783           genrtl_while_stmt (t);
784           break;
785
786         case DO_STMT:
787           genrtl_do_stmt (t);
788           break;
789
790         case IF_STMT:
791           genrtl_if_stmt (t);
792           break;
793
794         case COMPOUND_STMT:
795           genrtl_compound_stmt (t);
796           break;
797
798         case BREAK_STMT:
799           genrtl_break_stmt ();
800           break;
801
802         case CONTINUE_STMT:
803           genrtl_continue_stmt ();
804           break;
805
806         case SWITCH_STMT:
807           genrtl_switch_stmt (t);
808           break;
809
810         case CASE_LABEL:
811           genrtl_case_label (t);
812           break;
813
814         case LABEL_STMT:
815           expand_label (LABEL_STMT_LABEL (t));
816           break;
817
818         case GOTO_STMT:
819           genrtl_goto_stmt (GOTO_DESTINATION (t));
820           break;
821
822         case ASM_STMT:
823           genrtl_asm_stmt (ASM_CV_QUAL (t), ASM_STRING (t),
824                            ASM_OUTPUTS (t), ASM_INPUTS (t),
825                            ASM_CLOBBERS (t), ASM_INPUT_P (t));
826           break;
827
828         case SCOPE_STMT:
829           genrtl_scope_stmt (t);
830           break;
831
832         default:
833           if (lang_expand_stmt)
834             (*lang_expand_stmt) (t);
835           else 
836             abort ();
837           break;
838         }
839
840       /* Restore saved state.  */
841       current_stmt_tree ()->stmts_are_full_exprs_p
842         = saved_stmts_are_full_exprs_p;
843
844       /* Go on to the next statement in this scope.  */
845       t = TREE_CHAIN (t);
846     }
847 }
848