Re: [patch, fortran] Fix PR 91443

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [patch, fortran] Fix PR 91443

Thomas Koenig-6
Hi Janne,

> The patch itself looks Ok. One worry, are you introducing an
> O(N**2)(?) algorithm (looping over all symbols for every symbol?), and
> does this cause performance issues when compiling some gigantic F77
> project?

This is a single pass over the code, so O(N) for the code size.
The lookup is O(log M), where M is the number of global symbols
in the file, so altogether, we're at O(N*log M), which should be OK.

Thanks for the review.

Committed as r274551.

I will add the documentation about the change in behavior later.

Regards

        Thomas
Reply | Threaded
Open this post in threaded view
|

What to do with argument mismatches in Fortran (was: [patch, fortran] Fix PR 91443)

Thomas Koenig-6
I wrote:

> Committed as r274551.

Well, this revision appears to have woken quite a few bugs from their
slumber.  While argument mismatch was always illegal, it seems to have
been a common idiom at one time.  And, like almost all bad habits of
the past, SPEC also has this (see PR 91473, where you can see thatt a
rather large number of SPEC tests now require -std=legacy).

So, what to do?  Is -std=legacy the right option, or should we add
something different (like -faccept-argument-mismatch), which we
could then set by -std=legacy?  And is there anything special
we should be doing after we have diagnoses the problem, if the
user simply wants to run the code?
Reply | Threaded
Open this post in threaded view
|

Re: What to do with argument mismatches in Fortran (was: [patch, fortran] Fix PR 91443)

N.M. Maclaren
On Aug 20 2019, Steve Kargl wrote:

>On Tue, Aug 20, 2019 at 09:56:27PM +0200, Thomas Koenig wrote:
>> I wrote:
>>
>> > Committed as r274551.
>>
>> Well, this revision appears to have woken quite a few bugs from their
>> slumber.  While argument mismatch was always illegal, it seems to have
>> been a common idiom at one time.  And, like almost all bad habits of
>> the past, SPEC also has this (see PR 91473, where you can see thatt a
>> rather large number of SPEC tests now require -std=legacy).

Yes and no.  In de jure standard Fortran, it always has been illegal,
but the de facto standards were not always the same.  This caused a LOT
of debate in the early 1970s :-)  It was also an essential facility, for
various reasons, none of which have applied since Fortran 90.

>> So, what to do?  Is -std=legacy the right option, or should we add
>> something different (like -faccept-argument-mismatch), which we
>> could then set by -std=legacy?  And is there anything special
>> we should be doing after we have diagnoses the problem, if the
>> user simply wants to run the code?
>
>Perhaps, something along the lines of -fallow-invalid-boz
>I recently introduced.  Issue an error be default, but
>have -fallow-argument-mismatch downgrades the error to a
>warning.  The only way to disable the warning is with -w.
>
>Personally, if gfortran can detect an error in code, I think
>it should report the error to the user.

I agree.


Regards,
Nick Maclaren,