This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Q's about use of is_gimple_reg_rhs/is_gimple_tmp_var


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]