As mentioned in other replies, variables references in clocked
processes can represent either registered or combinatorial logic.
Some organizations discourage use of variables for registered logic.
For such circumstances, it is useful to have a set of coding rules to
allow use of variables for combinatorial logic such that inadvertent
registered logic is not created from references to variables. These
ground rules are similar to those for avoiding latches in
combinatorial processes: use up-front, default assignments to all
variables in the process, before any conditional statements (not
including the "if rising_edge..."). This ensures that no variable,
when referenced later in the process, can contain a value stored in a
previous clock cycle, and thus no register would be inferred.
Because the inference of a register is based on the reference relative
to the most recent assignment, it is possible to have a reference to
the same variable infer registered and combinatorial logic. Consider
the case of a conditional assignment to a variable early in the
process, then later (in the same clock cycle) the variable is
referenced. Whether or not the most recent assignment was in a
previous clock cycle depends upon the conditional logic associated
with the assignment statement. The synthesized hardware will use the
same conditional logic to control a multiplexer that selects either
the combinatorial logic, or the output of a register fed from the same
combinatorial logic (e.g. a bypass multiplexer on the output of the
register).
Andy