------- Comment #6 from mikael at gcc dot gnu dot org  2009-01-04 00:40 -------
(In reply to comment #5)
> (In reply to comment #4)
> > Created an attachment (id=17016)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17016&action=view) [edit]
> > fix
> > 
> > Does anyone know the use of the block variable I remove in this patch?
> > 
> 
> Yes indeed.  When I wrote this function, this block of code needed to be 
> merged
> as  the comments says:
>           /* Generate the temporary.  Merge the block so that the
>              declarations are put at the right binding level.  */
> 
> The second sentence needs to go in your patch:-)
> 
> What I have no recall of is why the block had to be merged.  I believe that it
> was conditional on the intent of the argument.

That's not what I was asking, sorry. I'll try to be clearer. 
The block variable seems to hold nothing. 

271    gfc_start_block (&block);
272    tmp = gfc_typenode_for_spec (&e->ts);
273    tmp = gfc_trans_create_temp_array (&se->pre, &se->post,
274                                       &tmp_loop, info, tmp,
275                                       false, true, false);
276    gfc_add_modify_expr (&se->pre, size, tmp);
277    tmp = fold_convert (pvoid_type_node, info->data);
278    gfc_add_modify_expr (&se->pre, data, tmp);
279    gfc_merge_block_scope (&block);

The above is your initial commit. 
As gfc_trans_create_temp_array is putting his code in se->pre and se->post, 
it looks like no code goes to the block variable which is useless then. 
Or do I miss something?

This is largely off-topic though. It is just something I wondered when I looked
at the code. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38669

Reply via email to