This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Checking for the Programming Language inside GCC
- From: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- To: "Shobaki, Ghassan" <Ghassan dot Shobaki at amd dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 28 Apr 2009 20:02:10 +0200
- Subject: Re: Checking for the Programming Language inside GCC
- References: <912DA18E911D8B418824641EF1541F3C0D5AFC@ssvlexmb2.amd.com>
Shobaki, Ghassan wrote:
In some optimization passes it may be useful to know the programming
language that we are compiling. Is there a way to get that information
in the middle end and back end?
I am not sure that would be a good idea. In fact you are suggesting that
the intermediate representation[s] (ie Gimple) is not intermediate
enough, since you need something more (like the source language).
And there might be some scenarii where making a programming language
dependent optimization is wrong. Consider for example compiling with
your GCC the output of the old f2c (fortran to C) translator. Would you
consider that being C or Fortran?
I would believe you should at least explain what exactly are the
language dependent optimizations you are thinking of (is it for matrix
code in Fortran vs C?).
Still, I tend to believe that if you really need some language specific
information, that would be better settled in the long term thru an
evolution or enhancement of the middle end representations...
Regards.
--
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} ***