GCC Middle and Back End API Reference
stmt.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void expand_label (tree)
 
bool parse_output_constraint (const char **, int, int, int, bool *, bool *, bool *)
 
bool parse_input_constraint (const char **, int, int, int, int, const char *const *, bool *, bool *)
 
tree resolve_asm_operand_names (tree, tree, tree, tree)
 
rtx_insnlabel_rtx (tree)
 
rtx_insnforce_label_rtx (tree)
 
rtx_code_labeljump_target_rtx (tree)
 
void expand_case (gswitch *)
 
void expand_sjlj_dispatch_table (rtx, vec< tree >)
 

Function Documentation

◆ expand_case()

void expand_case ( gswitch * stmt)
extern

◆ expand_label()

void expand_label ( tree label)
extern
Declarations and data structures for stmt.cc.
   Copyright (C) 2013-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Handle goto statements and the labels that they can go to.   
Specify the location in the RTL code of a label LABEL,
which is a LABEL_DECL tree node.

This is used for the kind of label that the user can jump to with a
goto statement, and for alternatives of a switch or case statement.
RTL labels generated for loops and conditionals don't go through here;
they are generated directly at the RTL level, by other functions below.

Note that this has nothing to do with defining label *names*.
Languages vary in how they do that and what that even means.   

References DECL_NAME, DECL_NONLOCAL, DECL_RTL, do_pending_stack_adjust(), emit_label(), expand_builtin_setjmp_receiver(), FORCED_LABEL, forced_labels, gen_rtx_INSN_LIST(), ggc_alloc(), IDENTIFIER_POINTER, jump_target_rtx(), LABEL_NAME, maybe_set_first_label_num(), nonlocal_goto_handler_labels, and NULL.

Referenced by expand_gimple_stmt_1().

◆ expand_sjlj_dispatch_table()

void expand_sjlj_dispatch_table ( rtx dispatch_index,
vec< tree > dispatch_table )
extern
Like expand_case but special-case for SJLJ exception dispatching.   
Expand the dispatch to a short decrement chain if there are few cases
to dispatch to.  Likewise if neither casesi nor tablejump is available,
or if flag_jump_tables is set.  Otherwise, expand as a casesi or a
tablejump.  The index mode is always the mode of integer_type_node.
Trap if no case matches the index.

DISPATCH_INDEX is the index expression to switch on.  It should be a
memory or register operand.

DISPATCH_TABLE is a set of case labels.  The set should be sorted in
ascending order, be contiguous, starting with value 0, and contain only
single-valued case labels.   

References BLOCK_FOR_INSN(), build_int_cst(), CASE_HIGH, CASE_LABEL, CASE_LOW, CONST0_RTX, CONST1_RTX, copy_to_mode_reg(), do_jump_if_equal(), do_pending_stack_adjust(), emit_case_dispatch_table(), emit_label(), expand_builtin_trap(), force_expand_binop(), free_temp_slots(), gen_label_rtx(), get_last_insn(), ggc_alloc(), i, integer_type_node, jump_target_rtx(), make_tree(), NEXT_INSN(), NULL, NULL_TREE, OPTAB_DIRECT, reorder_insns(), targetm, TYPE_MODE, and profile_probability::uninitialized().

Referenced by sjlj_emit_dispatch_table().

◆ force_label_rtx()

rtx_insn * force_label_rtx ( tree label)
extern
As label_rtx, but additionally the label is placed on the forced label
list of its containing function (i.e. it is treated as reachable even
if how is not obvious).   
As above, but also put it on the forced-reference list of the
function that contains it.   

References decl_function_context(), forced_labels, gcc_assert, label_rtx(), and vec_safe_push().

Referenced by decode_addr_const().

◆ jump_target_rtx()

rtx_code_label * jump_target_rtx ( tree label)
extern
As label_rtx, but checks that label was not deleted.   
As label_rtx, but ensures (in check build), that returned value is
an existing label (i.e. rtx with code CODE_LABEL).   

References ggc_alloc(), and label_rtx().

Referenced by construct_init_block(), expand_case(), expand_goto(), expand_label(), expand_sjlj_dispatch_table(), label_rtx_for_bb(), and sjlj_emit_dispatch_table().

◆ label_rtx()

rtx_insn * label_rtx ( tree label)
extern
Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary.
If label was deleted, the corresponding note
(NOTE_INSN_DELETED{_DEBUG,}_LABEL) insn will be returned.   
Return the rtx-label that corresponds to a LABEL_DECL,
creating it if necessary.   

References DECL_NONLOCAL, DECL_RTL, DECL_RTL_SET_P, FORCED_LABEL, gcc_assert, gen_label_rtx(), ggc_alloc(), LABEL_PRESERVE_P, r, SET_DECL_RTL, and TREE_CODE.

Referenced by dump_eh_tree(), dw2_build_landing_pads(), emit_case_dispatch_table(), expand_asm_stmt(), expand_builtin(), expand_expr_real_1(), finish_eh_generation(), force_label_rtx(), jump_target_rtx(), mark_transaction_restart_calls(), rtl_make_eh_edge(), and sjlj_emit_dispatch_table().

◆ parse_input_constraint()

bool parse_input_constraint ( const char ** constraint_p,
int input_num,
int ninputs,
int noutputs,
int ninout,
const char *const * constraints,
bool * allows_mem,
bool * allows_reg )
extern

◆ parse_output_constraint()

bool parse_output_constraint ( const char ** constraint_p,
int operand_num,
int ninputs,
int noutputs,
bool * allows_mem,
bool * allows_reg,
bool * is_inout )
extern
Parse the output constraint pointed to by *CONSTRAINT_P.  It is the
OPERAND_NUMth output operand, indexed from zero.  There are NINPUTS
inputs and NOUTPUTS outputs to this extended-asm.  Upon return,
*ALLOWS_MEM will be TRUE iff the constraint allows the use of a
memory operand.  Similarly, *ALLOWS_REG will be TRUE iff the
constraint allows the use of a register operand.  And, *IS_INOUT
will be true if the operand is read-write, i.e., if it is used as
an input as well as an output.  If *CONSTRAINT_P is not in
canonical form, it will be made canonical.  (Note that `+' will be
replaced with `=' as part of this process.)

Returns TRUE if all went well; FALSE if an error occurred.   

References error(), ggc_alloc(), ggc_alloc_string(), and warning().

Referenced by expand_asm_stmt(), find_func_aliases(), operands_scanner::get_asm_stmt_operands(), gimple_regimplify_operands(), gimplify_asm_expr(), walk_gimple_asm(), and walk_stmt_load_store_addr_ops().

◆ resolve_asm_operand_names()

tree resolve_asm_operand_names ( tree string,
tree outputs,
tree inputs,
tree labels )
extern
Resolve the names of the operands in *POUTPUTS and *PINPUTS to numbers,
and replace the name expansions in STRING and in the constraints to
those numbers.  This is generally done in the front end while creating
the ASM_EXPR generic tree that eventually becomes the GIMPLE_ASM.   

References build_string(), check_unique_operand_names(), free(), ggc_alloc(), NULL, resolve_operand_name_1(), TREE_CHAIN, TREE_PURPOSE, TREE_STRING_POINTER, and TREE_VALUE.