This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/18022] problem with structure and calling a function
- From: "paulthomas2 at wanadoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2005 09:38:02 -0000
- Subject: [Bug fortran/18022] problem with structure and calling a function
- References: <20041015190149.18022.gruel@astro.ufl.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From paulthomas2 at wanadoo dot fr 2005-07-08 09:37 -------
(In reply to comment #1)
> This looks like it's a dupe of 15553
> *** This bug has been marked as a duplicate of 15553 ***
This is not correct - 15553 has been resolved.
The present bug comes about because the scalarizer does not recognise that the
lvalues in pts%x = char2real_1d(tab_c(:,1)) are components in an array of
derived types. It instead treats them as an array of reals. This is odd because
rbuffer = char2real_1d(tab_c(:,1))
pts%x = rbuffer
works correctly.
There is something screwed up in gfc_trans_arrayfunc_assign that is causing
this problem. This can be confirmed by rewriting the two assignments as
pts%x = 1.0*char2real_1d(tab_c(:,1))
pts%y = 1.0*char2real_1d(tab_c(:,2)), which now works correctly!!
Thus emboldened, I emliminated the branch to gfc_trans_arrayfunc_assign,
whereupon the bug disappears. What is this function for? The rest of
gfc_trans_assignment does its job correctly.
I will regtest over the weekend and check out whether it is "de-optimising" any
code or not.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18022