------- Comment #2 from rguenth at gcc dot gnu dot org  2009-09-29 10:01 -------
I wonder why it uses the extra temporary - that shouldn't be necessary.

Ah, it's because of

  else if (ts.type == BT_DERIVED)
    {
      gfc_add_block_to_block (&block, &lse->pre);
      gfc_add_block_to_block (&block, &rse->pre);
      tmp = gfc_evaluate_now (rse->expr, &block);
      tmp = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lse->expr), tmp);
      gfc_add_modify (&block, lse->expr, tmp);

changing that to something that doesn't call gfc_evaluate_now in the
correct cases should fix this.  What do we expect there?  My first
bet would be to use EXPR_P as a check.  Or maybe we can drop the
gfc_evaluate_now call completely here?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-09-29 10:01:31
               date|                            |


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

Reply via email to