Re: [patch, fortran] Fix PR 87689, wrong decls / ABI violation on POWER

2019-02-19 Thread Bob Deen via gcc-patches

On 2/18/19 12:48 AM, Janne Blomqvist wrote:

On Sun, Feb 17, 2019 at 8:19 PM Thomas Koenig  wrote:


Hello world,

the attached patch fixes a rather bad ABI violation on POWER systems.
...



I agree, although we're close to the GCC-9 release, it's better to get
this in now. So Ok.

I wonder if we shouldn't exorcise all the varargs stuff, it seems to
cause more problems than benefits? But not in stage4 if we can avoid
it..



Please don't.  Some of us still use varargs interfaces (in my case, 
Fortran calling C stdarg subroutines).


Thanks...

-Bob Deen  @  NASA-JPL Multimission Image Processing Lab
bob.d...@jpl.nasa.gov


Re: [patch, fortran] Fix PR 87689, wrong decls / ABI violation on POWER

2019-02-25 Thread Bob Deen via gcc-patches

On 2/19/19 2:44 PM, Thomas Koenig wrote:

Bob,


Some of us still use varargs interfaces (in my case, Fortran calling C
stdarg subroutines).


The problem for us is that that sometimes using varargs made standard-
conforming Fortran code like, in file a.f

subroutine foo(a)
print *,a
end

and in file main.f

programme main
call foo(1.0)
end

depend ABI details: The call to foo used to be called using
the varargs convention, and the subroutine foo was compiled
as a non-varargs function.

This "worked" until PR 87689 showed that this breaks
standard-conforming Fortran code on a primary gcc platform.

I don't know if that makes a difference for the platform you work
on.  For the System V AMD64 ABI, I suspect it actually might not
matter (at least from glancing at the corresponding Wikipedia
article), but I am _not_ an expert in this field, so please take this
with a chunk of rock salt of appropriate size.

So, we cannot really keep this as a feature (note that varargs
are also not C interoperable).


Okay.  But I hope you don't let the perfect be the enemy of the good. 
That particular platform is not a concern for us, so if you break it 
there I'm not happy, but it's not the end of the world either.  But 
please don't break it other places just because it doesn't work on that 
one platform.  I know it's not good design practice to have that kind of 
platform-dependent behavior, but sometimes practicalities force less 
than ideal choices.


Thanks...

-Bob