[PATCH] Fortran : Fill in missing array dimensions using the lower, bound (for review)

Mark Eggleston mark.eggleston@codethink.co.uk
Thu Jul 2 11:42:14 GMT 2020


On 01/07/2020 23:01, Jerry DeLisle wrote:
>
>
> On 6/27/20 1:40 AM, Thomas Koenig via Fortran wrote:
>> Hi Mark,
>>
>>> Use -fdec-add-missing-indexes to enable feature. Also enabled by fdec.
>>> A warning that the lower bound is being used for a mission dimension
>>> is output unless suppressed by using -Wno-missing-index.
>>
>> This is... seriously problematic.  I forsee all sorts of not-so-funny
>> interactions with more modern features.
>>
>> What do people actually do with this kind of code?  What kind of test
>> cases do you have that "work" with this?
>>
>> And people would actually want to save a few keystrokes so they don't
>> have to write A(N,M,1) instead of A(N,M)?  And is this even the right
>> fix, how sure are you of the semantics; is there documentation for
>> this feature (maybe on Bitsavers)?  If not, this is not be done.
>>
>> If this goes in at all, I want this rejected with any modern Fortran
>> feature, i.e. it should not be contain
>>
>> - allocatable arrays
>> - coarrays
>> - pointers
>> - derived types
>> - CLASS
>> - assumed-shape arrays
>> - assumed-rank arrays (well, it probably doesn't make sense)
>> - KIND=4 characters
>> - as an argument to any of the array intrinsics like MATMUL,
>>   EOSHIFT, ...
>>
>> but even with these restrictions, I will still take a lot of convincing
>> that this make sense.
>>
>> Just imagine what will happen if people specify -fdec for some
>> relatively benign reason (for example because they want -fdec-math)
>> and start not finding bugs in their code because of this feature.
>>
>> Best regards
>>
>>     Thomas
>
> Please stop fixing problematic DEC programs by using the compiler as 
> the pet tool. Use an editor or python or some suitable tool to 
> initialize arrays properly.

Agreed, I was tasked with upstreaming various legacy patches, 
fortunately there has been a parallel effort refactor Fortran code to 
reduce the need for these patches.  It is likely that this one is no 
longer required.  There is only one more is left, hopefully that will 
also be addressed in the code.  I'll relay your opinion as an argument 
for not attempting the last patch and I can address the many Fortran PRs 
instead.

regards,

Mark

>
> I appreciate the effort, but need things run by here before the effort 
> so you can spend the effort on really true compiler bugs, and not on 
> the wishes of perhaps a paying customer.
>
> We should never have caved on the previous DEC enhancement.
>
> Just my humble opinion.
>
> Jerry
>
-- 
https://www.codethink.co.uk/privacy.html



More information about the Fortran mailing list