Debug Information - GNU Compiler Collection (GCC) Internals
Description: GNU Compiler Collection (GCC) Internals

Next: Insns, Previous: Assembler, Up: RTL

### 10.18 Variable Location Debug Information in RTL

Variable tracking relies on `MEM_EXPR` and `REG_EXPR` annotations to determine what user variables memory and register references refer to.

Variable tracking at assignments uses these notes only when they refer to variables that live at fixed locations (e.g., addressable variables, global non-automatic variables). For variables whose location may vary, it relies on the following types of notes.

`(var_location:` mode var exp stat`)`
  Binds variable `var`, a tree, to value exp, an RTL expression. It appears only in `NOTE_INSN_VAR_LOCATION` and `DEBUG_INSN`s, with slightly different meanings. mode, if present, represents the mode of exp, which is useful if it is a modeless expression. stat is only meaningful in notes, indicating whether the variable is known to be initialized or uninitialized.

`(debug_expr:` mode decl`)`
  Stands for the value bound to the `DEBUG_EXPR_DECL` decl, that points back to it, within value expressions in `VAR_LOCATION` nodes.