Jump to content

Frontend or Backend doing optimization

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Termana

Termana

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,057 posts
As far as I have been able to tell, g++ is a frontend to the GCC backend, but also there is several other languages that are made for the GCC backend, and the front end of the language will compile it to a sort of intermediate language that gets fed into GCC and made into an executable. However what I have not been able to find out is weather it is the front end that must do the optimizations to get a more optimised assembly output, or weather it is the backend. I am pretty sure it is the backend that does the optimizing but I just wanted to make sure.

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
First of, I think you have misunderstood something. GCC is simply a collection of tools, which its name also says, GNU Compiler Collection. gcc, gcl, g++, and so on are just tools in this collection.

#3
Termana

Termana

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,057 posts
The GNU Compiler Collection (usually shortened to GCC) is a compiler system supporting various programming languages produced by the GNU Project.
I think you'll find that GCC is a compiler backend.
Later in the same article I think I've found my answer anyway:
The behavior of GCC's back end is partly specified by preprocessor macros and functions specific to a target architecture, for instance to define the endianness, word size, and calling conventions. The front part of the back end uses these to help decide RTL generation, so although GCC's RTL is nominally processor-independent, the initial sequence of abstract instructions is already adapted to the target.
The exact set of GCC optimizations varies from release to release as it develops, but includes the standard algorithms, such as loop optimization, jump threading, common subexpression elimination, instruction scheduling, and so forth. The RTL optimizations are of less importance with the recent addition of global SSA-based optimizations on GIMPLE trees, as RTL optimizations have a much more limited scope, and have less high-level information.

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#4
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Cool.

#5
Termana

Termana

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,057 posts
Edit: ignore this post

Edited by Termana, 10 January 2009 - 05:44 AM.
This post was accidently posted.