[Bug fortran/18022] problem with structure and calling a function

gruel at astro dot ufl dot edu gcc-bugzilla@gcc.gnu.org
Fri Jul 8 13:34:00 GMT 2005


------- Additional Comments From gruel at astro dot ufl dot edu  2005-07-08 13:34 -------
Subject: Re:  problem with structure and calling a function



paulthomas2 at wanadoo dot fr wrote:
> ------- 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 wrote this function to read some data files. This data files can have 
some format not determin at the beggining so I read it in character 
after I check if there are only numerical element and I recuperate the 
coordinate (it's why I'm usin a pts definition). In my files I can have 
some "nan" or "inf" and this is a source at problem (I don't know how to 
manage it in fortran).
Perhaps there are a something more efficient and elegant to do this but 
I don't know it if it's the case.

> I will regtest over the weekend and check out whether it is "de-optimising" any 
> code or not.


Thanks,

	Nicolas


-- 


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



More information about the Gcc-bugs mailing list