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