On Tue, Nov 21, 2023 at 11:42:06AM +0100, Sebastian Huber wrote:
>
>
> On 21.11.23 11:34, Jakub Jelinek wrote:
> > > --- a/gcc/tree-profile.cc
> > > +++ b/gcc/tree-profile.cc
> > > @@ -281,10 +281,13 @@ gen_assign_counter_update (gimple_stmt_iterator
> > > *gsi, gcall *call, tree func,
> > > if (result)
> > > {
> > > tree result_type = TREE_TYPE (TREE_TYPE (func));
> > > - tree tmp = make_temp_ssa_name (result_type, NULL, name);
> > > - gimple_set_lhs (call, tmp);
> > > + tree tmp1 = make_temp_ssa_name (result_type, NULL, name);
> > > + gimple_set_lhs (call, tmp1);
> > > gsi_insert_after (gsi, call, GSI_NEW_STMT);
> > > - gassign *assign = gimple_build_assign (result, tmp);
> > > + tree tmp2 = make_ssa_name (TREE_TYPE (result));
> > > + gassign *assign = gimple_build_assign (tmp2, NOP_EXPR, tmp1);
> > > + gsi_insert_after (gsi, assign, GSI_NEW_STMT);
> > > + assign = gimple_build_assign (result, gimple_assign_lhs (assign));
> > When you use a temporary tmp2 for the lhs of the conversion, you can just
> > use it here,
> > assign = gimple_build_assign (result, tmp2);
> >
> > Ok for trunk with that change.
>
> Just a question, could I also use
>
> tree tmp2 = make_temp_ssa_name (TREE_TYPE (result), NULL, name);
>
> ?
>
> This make_temp_ssa_name() is used throughout the file and the new
> make_ssa_name() would be the first use in this file.
Yes. The only difference is that it won't be _234 = (type) something;
but PROF_time_profile_234 = (type) something; in the dumps, but sure,
consistency is useful.
Jakub