[Bug fortran/66681] Wrong result in assigning this_image() to a complex coarray
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 7 12:58:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66681
--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
This cures the problem in all its guises:
Index: /home/pault/svn/trunk/gcc/fortran/trans-expr.c
===================================================================
*** /home/pault/svn/trunk/gcc/fortran/trans-expr.c (revision 227118)
--- /home/pault/svn/trunk/gcc/fortran/trans-expr.c (working copy)
*************** gfc_trans_scalar_assign (gfc_se * lse, g
*** 8236,8241 ****
--- 8236,8244 ----
gfc_add_block_to_block (&block, &lse->pre);
gfc_add_block_to_block (&block, &rse->pre);
+ if (TREE_CODE (lse->expr) == SAVE_EXPR)
+ lse->expr = TREE_OPERAND (lse->expr, 0);
+
gfc_add_modify (&block, lse->expr,
fold_convert (TREE_TYPE (lse->expr), rse->expr));
}
(It is regtesting right now but looks OK)
I will do that business as long a somebody explains to me why one might ever
want to store the value returned by this_image() as a complex :-)
Paul
More information about the Gcc-bugs
mailing list