This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Q's about use of is_gimple_reg_rhs/is_gimple_tmp_var
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: neroden at fastmail dot fm
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 16 Aug 04 06:50:00 EDT
- Subject: 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.