genic.f miscompiles with -O2 or greater
Tobias Burnus
burnus@net-b.de
Mon Jul 26 05:41:00 GMT 2010
Jack Howarth wrote:
> On Sun, Jul 25, 2010 at 10:17:36PM +0200, Tobias Burnus wrote:
>
>> Jack Howarth wrote:
>>
>>> A reduced example of this is...
>>> [...]
>>>
>>>
>> That is overly reduced. Unless, you have a complete, compilable run-time
>> example, it is difficult to find out what goes wrong
> I think the testcase captures the core of the problem.
Well, it might illustrate a problematic part, but it is not a (runable)
test case.
> [...] The problem appears to be that
> character*4 iac(*)
> when passed to...
> SUBROUTINE cmpric(iac)
> [...]
>
Does it work if you compile with -O0? Does it work if you add TARGET?
I refuse to think or look at the problem in more detail without a
runable test case (i.e. one which fails due to this problem) - it takes
simply too much time, I would like to use for other things.
> doesn't consider iac to be a pointer in
> the argument list since it is declared as
> iac(*) within the subroutine. What do other
> fortran compilers do with this code?
In (g)Fortran, all arguments (except when using %VAL/VALUE) are
pointers. And I have no idea without a small test case what other
compilers do.
Tobias
More information about the Fortran
mailing list