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


    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?

This is the essence of the problem I reported a few days ago with the
ACATS test c761006 and in that case it wasn't a "user variable", but a
DECL_ARTIFICIAL variable created by the Ada front end.

The point is that if you have

	var = rhs1;
	...
	var = rhs2;

and RHS2 may trap, you have to ensure the second assignment is treated
specially, as

	tmp = rhs2;
	var = tmp;

The condition for when you have to make this temporary is whether this is
the only assignment to VAR.  I *thought* this was the same as TREE_READONLY,
not apparently not.


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