This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: (g)fortran support for MPX (was: Re: [PATCH, MPX, 2/X] Pointers Checker [8/25] Languages support)


2013/11/18 Tobias Burnus <burnus@net-b.de>:
> Ilya Enkovich wrote:
>>
>> The issue is that users do not get what expect. I do not want someone
>> having mixed codes get instrumentation for his Java/Fortran/Ada
>> functions which slows them down and does nothing useful. What is the
>> point to allow checks of pointer bounds for language with no pointers?
>
>
> Talking about Fortran, I wonder which modifications are required to get it
> working. Can you give some pointers? I lost a bit track.
>
> (For readers, who haven't followed: See
> http://gcc.gnu.org/wiki/Intel_MPX_support_in_the_GCC_compiler )
>
> In Fortran, often an array is described by an array descriptor, a struct
> which carries both the pointer address and the array bounds. Thus, that
> makes it simpler to check for bound violations at runtime (existing
> -fcheck=bounds). However, arrays can also be passed as in a way that only
> the address is known – in that case, one has the same issues as with C. One
> place where the issue occurs is interoperating with C, but also within
> Fortran it can occur. I think especially for interoperability with C (C++
> with extern "c", etc.), having the checks would be useful.
>
> I have to admit that it is not completely clear to me when to best add MPX
> annotations with Fortran, but as it is explicitly controlled by a
> compile-time flag, there is no real reason for not using it.

Unfortunately I have only basic Fortran knowledge and cannot fully
estimate what may be required for its enabling.  From stability point
of view there should not be significant problem. Instrumentation
itself should work OK, but most probably you would get more
instrumentation than you want.  E.g. if you have array bounds placed
near array pointer, you do not need to use expensive Bounds Tables. If
you want only some particular type of pointers to be instrumented then
you need to add such feature.  Also some language features may be
required (e.g. for C new attributes were added to mark arrays with
variable size and functions not requiring instrumentation).

Ilya

>
> Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]