Announcement

Collapse
No announcement yet.

GCC 4.5 Steps Closer To Release

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by XorEaxEax View Post
    Don't know if there's simple words for it. But basically it means that instead of the compiler looking at all the object files as single entities, it allows the compiler to look at all the object files that make up a project as one big program which can help alot when the compiler needs to determine when to inline, reduce duplicate funcionality, eliminate dead code etc...
    But that means faster executable or just faster compilation?
    Also if the first case is the real one, the dead code elimination means smaller executables and thus faster startup and lower memory usage, right?

    Comment


    • #12
      Originally posted by Apopas View Post
      But that means faster executable or just faster compilation?
      Also if the first case is the real one, the dead code elimination means smaller executables and thus faster startup and lower memory usage, right?
      Faster executable, and yes it's also likely that the executable will end up being smaller with link time optimization. Also you should combine '-flto' with '-fwhole-program' for the best results (enables more aggressive interprocedural optimizations)

      Comment


      • #13
        Originally posted by XorEaxEax View Post
        Faster executable, and yes it's also likely that the executable will end up being smaller with link time optimization. Also you should combine '-flto' with '-fwhole-program' for the best results (enables more aggressive interprocedural optimizations)
        I'll keep it in mind when I install gcc-4.5 in my Gentoo. Thanks a lot XorEaxEax

        Comment


        • #14
          Can you explain the difference between "-combine -fwhole-program *.c" and this new -flto? From your explanation it sounds similar.

          Comment


          • #15
            Originally posted by curaga View Post
            Can you explain the difference between "-combine -fwhole-program *.c" and this new -flto? From your explanation it sounds similar.
            As I understand it -flto is basically an improved version of '--combine' and that '--combine' will be deprecated.

            Comment


            • #16
              Thanks. Makes sense.

              Comment


              • #17
                What's new: LTO & plugins!

                Originally posted by Raine View Post
                What's is comming new to 4.5 release?
                In addition of Link Time Optimization, there is also another new important feature of GCC 4.5: plugins.

                GCC plugins enable extra functionality inside the compiler, such as
                • library specific optimizations
                • library (or application) specific diagnostics
                • everything but the kitchen sink you want to enable inside GCC


                A simple example of library (or application) specific optimization is the transformation of fprintf(stdout, ...) to printf(...). This is better done inside the compiler (in particular, to take into account inlining, etc..).

                A simple example of library specific diagnostics could be to issue a warning when a user C function calls malloc but does not check that the result returned by malloc is not null (it could be null when the memory is full).

                Plugins are usually coded in C (they are required to have a GPL compatible licence), and depends upon the exact version of the compiler (so a plugin coded for GCC 4.5.0 probably won't run on GCC 4.5.1 or GCC 4.6.0). You should expect to learn & understand a bit of GCC internals before coding GCC plugins.

                There is even a plugin, called MELT, which provides you with a higher-level language (with Lispy syntax) to code more quickly your GCC plugins.


                One could hope that several plugins will appear after GCC 4.5. It is hoped that major huge free software (e.g. KDE or GNOME graphical environments, Linux kernel, etc..) wil eventually develop their own GCC plugins to help compile them better (e.g. to validate some coding styles rules, etc...).

                Disclaimer: I am the author of MELT, and I am a big enthusiast of the GCC plugin idea. But some important GCC hackers still believe that plugins are not really important.


                --
                Basile Starynkevitch - http://starynkevitch.net/Basile

                Comment

                Working...
                X