public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* plugin-provided pragmas & Fortran or Ada?
@ 2010-06-22  6:28 Basile Starynkevitch
  2010-06-22  7:13 ` Duncan Sands
  2010-06-22  8:59 ` Tobias Burnus
  0 siblings, 2 replies; 6+ messages in thread
From: Basile Starynkevitch @ 2010-06-22  6:28 UTC (permalink / raw)
  To: gcc; +Cc: jeremie.salvucci

Hello,

Assuming a plugin (e.g. MELT) add a new pragma using PLUGIN_PRAGMAS, is
this pragma usable from Ada or Fortran code?

I am not very familiar with Ada or Fortran. I believe Ada has some
syntax for pragmas -but do Ada pragma have the same API inside GCC
plugins as C or C++ pragmas?- and I am not sure about Fortran. Many
Fortran dialects or implementations parse specially some kind of
comments -but I don't know if these are giving pragma events to plugins.

The intended MELT extension I have in mind would convert Gimple (built
by GCC from Ada or C or C++ or Fortran code) to some low-level C code
suitable for Frama-C. Frama-C is a free (LGPL licensed, coded in Ocaml)
static analyzer developed by my colleagues at CEA LIST (& also INRIA
Proval team). See http://frama-c.com/

Frama-C accept some special comments starting with /*@ in a language
called ACSL, see http://frama-c.com/acsl_tutorial_index.html and I was
thinking of using some new pragmas inside GCC to translate these pragmas
to ACSL syntax comments.

All this is exploratory work initiated by my intern Jeremie Salvucci. We
have no idea today if this can be worked out.

Cheers.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: plugin-provided pragmas & Fortran or Ada?
  2010-06-22  6:28 plugin-provided pragmas & Fortran or Ada? Basile Starynkevitch
@ 2010-06-22  7:13 ` Duncan Sands
  2010-06-22  7:18   ` Basile Starynkevitch
  2010-06-22  8:59 ` Tobias Burnus
  1 sibling, 1 reply; 6+ messages in thread
From: Duncan Sands @ 2010-06-22  7:13 UTC (permalink / raw)
  To: gcc

Hi Basile,

> Assuming a plugin (e.g. MELT) add a new pragma using PLUGIN_PRAGMAS, is
> this pragma usable from Ada or Fortran code?
>
> I am not very familiar with Ada or Fortran. I believe Ada has some
> syntax for pragmas -but do Ada pragma have the same API inside GCC
> plugins as C or C++ pragmas?- and I am not sure about Fortran. Many
> Fortran dialects or implementations parse specially some kind of
> comments -but I don't know if these are giving pragma events to plugins.

I'm pretty sure this won't work for Ada without modifying the Ada
front-end.

Ciao,

Duncan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: plugin-provided pragmas & Fortran or Ada?
  2010-06-22  7:13 ` Duncan Sands
@ 2010-06-22  7:18   ` Basile Starynkevitch
  2010-06-22  9:34     ` Duncan Sands
  2010-06-22 12:19     ` Eric Botcazou
  0 siblings, 2 replies; 6+ messages in thread
From: Basile Starynkevitch @ 2010-06-22  7:18 UTC (permalink / raw)
  To: Duncan Sands; +Cc: gcc

On Tue, 2010-06-22 at 08:58 +0200, Duncan Sands wrote:
> Hi Basile,
> 
> > Assuming a plugin (e.g. MELT) add a new pragma using PLUGIN_PRAGMAS, is
> > this pragma usable from Ada or Fortran code?
> >
> > I am not very familiar with Ada or Fortran. I believe Ada has some
> > syntax for pragmas -but do Ada pragma have the same API inside GCC
> > plugins as C or C++ pragmas?- and I am not sure about Fortran. Many
> > Fortran dialects or implementations parse specially some kind of
> > comments -but I don't know if these are giving pragma events to plugins.
> 
> I'm pretty sure this won't work for Ada without modifying the Ada
> front-end.

Are there any plugin hooks for Ada pragmas? Perhaps the Ada team might
consider adding some, if it is simple enough. Specific pragmas have
definitely their places in plugins.

Cheers.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: plugin-provided pragmas & Fortran or Ada?
  2010-06-22  6:28 plugin-provided pragmas & Fortran or Ada? Basile Starynkevitch
  2010-06-22  7:13 ` Duncan Sands
@ 2010-06-22  8:59 ` Tobias Burnus
  1 sibling, 0 replies; 6+ messages in thread
From: Tobias Burnus @ 2010-06-22  8:59 UTC (permalink / raw)
  To: basile; +Cc: gcc, jeremie.salvucci

On 06/22/2010 06:20 AM, Basile Starynkevitch wrote:
> Assuming a plugin (e.g. MELT) add a new pragma using PLUGIN_PRAGMAS, is
> this pragma usable from Ada or Fortran code?
> 
> I am not very familiar with Ada or Fortran. I believe Ada has some
> syntax for pragmas -but do Ada pragma have the same API inside GCC
> plugins as C or C++ pragmas?- and I am not sure about Fortran. Many
> Fortran dialects or implementations parse specially some kind of
> comments -but I don't know if these are giving pragma events to plugins.

Regarding Fortran: "Pragmas" seem to be only rarely used in Fortran
programs - with possible exception of the !DEC$ directives, which seem
to be mostly used for attributes and has been superseded mostly by the C
bindings of Fortran; !DEC$ has also been used for parallelization as
precursor of OpenMP.

gfortran only supports setting some attributes via !GCC$ (and supports
OpenMP) - but nothing more; cf.
http://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-Compiler-Directives.html
The plan is to support all function/variable attributes, but that's
still on the TODO list. Additionally, one might add more functionality,
but that's currently not even on the TODO list.

Thus, if you need more, it has to be programmed.

Tobias

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: plugin-provided pragmas & Fortran or Ada?
  2010-06-22  7:18   ` Basile Starynkevitch
@ 2010-06-22  9:34     ` Duncan Sands
  2010-06-22 12:19     ` Eric Botcazou
  1 sibling, 0 replies; 6+ messages in thread
From: Duncan Sands @ 2010-06-22  9:34 UTC (permalink / raw)
  To: basile; +Cc: gcc

Hi Basile,

>>> Assuming a plugin (e.g. MELT) add a new pragma using PLUGIN_PRAGMAS, is
>>> this pragma usable from Ada or Fortran code?
>>>
>>> I am not very familiar with Ada or Fortran. I believe Ada has some
>>> syntax for pragmas -but do Ada pragma have the same API inside GCC
>>> plugins as C or C++ pragmas?- and I am not sure about Fortran. Many
>>> Fortran dialects or implementations parse specially some kind of
>>> comments -but I don't know if these are giving pragma events to plugins.
>>
>> I'm pretty sure this won't work for Ada without modifying the Ada
>> front-end.
>
> Are there any plugin hooks for Ada pragmas? Perhaps the Ada team might
> consider adding some, if it is simple enough. Specific pragmas have
> definitely their places in plugins.

I'm pretty sure there are no such plugin hooks right now.

Ciao,

Duncan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: plugin-provided pragmas & Fortran or Ada?
  2010-06-22  7:18   ` Basile Starynkevitch
  2010-06-22  9:34     ` Duncan Sands
@ 2010-06-22 12:19     ` Eric Botcazou
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Botcazou @ 2010-06-22 12:19 UTC (permalink / raw)
  To: basile; +Cc: gcc, Duncan Sands

> Are there any plugin hooks for Ada pragmas? Perhaps the Ada team might
> consider adding some, if it is simple enough. Specific pragmas have
> definitely their places in plugins.

The Ada front-end is entirely isolated from the middle-end so we would need to 
devise a way of allowing the latter to dynamically affect the former.  That's 
certainly doable but not immediate.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-22  9:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-22  6:28 plugin-provided pragmas & Fortran or Ada? Basile Starynkevitch
2010-06-22  7:13 ` Duncan Sands
2010-06-22  7:18   ` Basile Starynkevitch
2010-06-22  9:34     ` Duncan Sands
2010-06-22 12:19     ` Eric Botcazou
2010-06-22  8:59 ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).