public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [Gimple] look for gcc command to start compiling from GIMPLE
@ 2010-01-28  9:20 charfi asma
  2010-01-28 14:31 ` Diego Novillo
  0 siblings, 1 reply; 6+ messages in thread
From: charfi asma @ 2010-01-28  9:20 UTC (permalink / raw)
  To: gcc-help

Hello,

Can I compile directly a gimple Intermediate forms to binary ?
i,e. How to tell compiler : do not run genericise.c nor gimplify.c
for example, If we want compiler to stop just after preprocessing, we use -E coptions.
So, is there an options that tells compiler: do not preprocess and start compiling from gimple IR.

thank you very much.

Asma



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

* Re: [Gimple] look for gcc command to start compiling from GIMPLE
  2010-01-28  9:20 [Gimple] look for gcc command to start compiling from GIMPLE charfi asma
@ 2010-01-28 14:31 ` Diego Novillo
  2010-01-28 15:26   ` Re : " charfi asma
  0 siblings, 1 reply; 6+ messages in thread
From: Diego Novillo @ 2010-01-28 14:31 UTC (permalink / raw)
  To: charfi asma; +Cc: gcc-help

On Thu, Jan 28, 2010 at 04:20, charfi asma <charfiasma@yahoo.fr> wrote:

> i,e. How to tell compiler : do not run genericise.c nor gimplify.c
> for example, If we want compiler to stop just after preprocessing, we use -E coptions.
> So, is there an options that tells compiler: do not preprocess and start compiling from gimple IR.

With gcc 4.5 you'll be able to do it using the LTO machinery with the
-flto switch:

$ gcc -flto -c file.c

generates file.o which contains a mix of gimple IL and final assembly.
 The representation of gimple is not in text form, however.

Diego.

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

* Re : [Gimple] look for gcc command to start compiling from GIMPLE
  2010-01-28 14:31 ` Diego Novillo
@ 2010-01-28 15:26   ` charfi asma
  2010-01-28 15:44     ` Diego Novillo
  0 siblings, 1 reply; 6+ messages in thread
From: charfi asma @ 2010-01-28 15:26 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-help

Thanks Diego,

but I think that my previous question was not very clear.
I asked for a gcc option to compile Gimple file directly (I have no file.c) I have file.gimple and I want to tell compiler: start your job from converting gimple to ssa and continue until reaching binary code.

thank you 

Asma



----- Message d'origine ----
De : Diego Novillo <dnovillo@google.com>
À : charfi asma <charfiasma@yahoo.fr>
Cc : gcc-help@gcc.gnu.org
Envoyé le : Jeu 28 Janvier 2010, 15 h 31 min 31 s
Objet : Re: [Gimple] look for gcc command to start compiling from GIMPLE

On Thu, Jan 28, 2010 at 04:20, charfi asma <charfiasma@yahoo.fr> wrote:

> i,e. How to tell compiler : do not run genericise.c nor gimplify.c
> for example, If we want compiler to stop just after preprocessing, we use -E coptions.
> So, is there an options that tells compiler: do not preprocess and start compiling from gimple IR.

With gcc 4.5 you'll be able to do it using the LTO machinery with the
-flto switch:

$ gcc -flto -c file.c

generates file.o which contains a mix of gimple IL and final assembly.
The representation of gimple is not in text form, however.

Diego.




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

* Re: Re : [Gimple] look for gcc command to start compiling from GIMPLE
  2010-01-28 15:26   ` Re : " charfi asma
@ 2010-01-28 15:44     ` Diego Novillo
  2010-01-29  9:47       ` Re : " charfi asma
  0 siblings, 1 reply; 6+ messages in thread
From: Diego Novillo @ 2010-01-28 15:44 UTC (permalink / raw)
  To: charfi asma; +Cc: gcc-help

On Thu, Jan 28, 2010 at 10:26, charfi asma <charfiasma@yahoo.fr> wrote:

> I asked for a gcc option to compile Gimple file directly (I have no file.c) I have file.gimple and I
> want to tell compiler: start your job from converting gimple to ssa and continue until reaching
> binary code.

Ah, no.  Nothing of the sort.  I've had thought of creating a text
representation for gimple that could be used as input to the compiler,
but so far is just a glimmer of thought, no concrete plans nor time to
implement them.


Diego.

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

* Re : Re : [Gimple] look for gcc command to start compiling from GIMPLE
  2010-01-28 15:44     ` Diego Novillo
@ 2010-01-29  9:47       ` charfi asma
  2010-01-29 14:08         ` Diego Novillo
  0 siblings, 1 reply; 6+ messages in thread
From: charfi asma @ 2010-01-29  9:47 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-help

Hello,

What about using -x options ?

I red in the GCC 4.4.2 manual that  " If you only want some of the stages of compilation, you can use ‘-x’ (or filename suffixes)
to tell gcc where to start, and one of the options ‘-c’, ‘-S’, or ‘-E’ to say where gcc is to stop "

but -x accept only this list of langauge:

Possible values for language
          are:
                  c c-header c-cpp-output
                  c++ c++-header c++-cpp-output
                  objective-c objective-c-header objective-c-cpp-output
                  objective-c++ objective-c++-header objective-c++-cpp-output
                  assembler assembler-with-cpp
                  ada
                  f77 f77-cpp-input f95 f95-cpp-input
                  java

I guess that  if assembler language is one element of the list above, we can tell compiler to start from linking pass: do not run "as" (assembler) nor "cpp" (preprocessor). 
So (as an alternative) can we add Gimple to this list of languages and telling compiler to not run cpp (preprocessor) ? Am I right ?

another alternative is to proceed just like  we want to add a Gimple GCC front. end.  I red that building a GCC front end for any langauge we choose is not a tricky task.

From your experience handling those forms, can you tell me, are those alternatives feasible or I am trying to invent sth wrong and not interesting at all (cause I think it is a good idea if gcc users can chose the input file they want and tell compiler where to start:. just like -E -s and -c that tell compiler where to stop).

Thank you very much.

Asma.




----- Message d'origine ----
De : Diego Novillo <dnovillo@google.com>
À : charfi asma <charfiasma@yahoo.fr>
Cc : gcc-help@gcc.gnu.org
Envoyé le : Jeu 28 Janvier 2010, 16 h 43 min 57 s
Objet : Re: Re : [Gimple] look for gcc command to start compiling from GIMPLE

On Thu, Jan 28, 2010 at 10:26, charfi asma <charfiasma@yahoo.fr> wrote:

> I asked for a gcc option to compile Gimple file directly (I have no file.c) I have file.gimple and I
> want to tell compiler: start your job from converting gimple to ssa and continue until reaching
> binary code.

Ah, no.  Nothing of the sort.  I've had thought of creating a text
representation for gimple that could be used as input to the compiler,
but so far is just a glimmer of thought, no concrete plans nor time to
implement them.


Diego.




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

* Re: Re : Re : [Gimple] look for gcc command to start compiling from   GIMPLE
  2010-01-29  9:47       ` Re : " charfi asma
@ 2010-01-29 14:08         ` Diego Novillo
  0 siblings, 0 replies; 6+ messages in thread
From: Diego Novillo @ 2010-01-29 14:08 UTC (permalink / raw)
  To: charfi asma; +Cc: gcc-help

On Fri, Jan 29, 2010 at 04:47, charfi asma <charfiasma@yahoo.fr> wrote:

> What about using -x options ?

That won't work, sorry.  The support for parsing a text representation
of gimple has just not been implemented yet.

> another alternative is to proceed just like  we want to add a Gimple GCC front. end.  I red
> that building a GCC front end for any langauge we choose is not a tricky task.

It's easier than it used to be, yes.

> From your experience handling those forms, can you tell me, are those alternatives feasible
> or I am trying to invent sth wrong and not interesting at all (cause I think it is a good idea if
> gcc users can chose the input file they want and tell compiler where to start:. just like -E -s
> and -c that tell compiler where to stop).

I think your idea is feasible and I encourage you to pursue it.  The
ability to parse gimple and start/stop the compiler at arbitrary
points of the compilation pipeline will bring many benefits (testing,
maintenance, etc).

It is not a simple project, however.  If you are interested, let me know.


Diego.

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

end of thread, other threads:[~2010-01-29 14:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-28  9:20 [Gimple] look for gcc command to start compiling from GIMPLE charfi asma
2010-01-28 14:31 ` Diego Novillo
2010-01-28 15:26   ` Re : " charfi asma
2010-01-28 15:44     ` Diego Novillo
2010-01-29  9:47       ` Re : " charfi asma
2010-01-29 14:08         ` Diego Novillo

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).