Q's about use of is_gimple_reg_rhs/is_gimple_tmp_var
Diego Novillo
dnovillo@redhat.com
Mon Aug 16 12:08:00 GMT 2004
On Mon, 2004-08-16 at 03:56, Nathanael Nerode wrote:
> In is_gimple_reg_rhs, it says:
>
> /* If the RHS of the MODIFY_EXPR may throw or make a nonlocal goto and
> the LHS is a user variable, then we need to introduce a temporary.
> ie temp = RHS; LHS = temp.
>
> This way the optimizers can determine that the user variable is
> only modified if evaluation of the RHS does not throw. */
>
> Is this really referring to "user variables" (!DECL_ARTIFICIAL), and is
> it essentially for debugging?
>
It's for correctness, not debugging:
V = foo();
If the call to foo does throw, the semantics of throw imply that the
assignment to V must not execute. That's why we expand this to:
tmp = foo ();
V = tmp;
Diego.
More information about the Gcc
mailing list