You are viewing nickclifton

Previous Entry | Next Entry

October 2010 GNU Toolchain Update

Deep Thought
Hi Guys,

  Here are the highlights of this month's merge: 

  * A GCC port to the Xilinx Microblaze architecture has been contributed.

   
  * A new function attribute - leaf - has been defined for GCC.  This is used to annotate functions that are outside of the current compilation unit and it allows the compiler to improve its dataflow analysis.

    Specifically, calls to functions with this attribute must return to the current compilation unit only by return or by exception handling.  They may not use longjmps, or call any function that is exported by the current compilation unit, or use a callback function that could end up in the current compilation unit.   The effect of this restriction is that these leaf functions cannot modify any data local the current compilation unit.

    Unlike traditional leaf functions, leaf functions may call other functions, just not ones exported by the current compilation unit.  They may also invoke signals, and if a signal handler is defined in the current compilation unit, and it uses static variables, then there could be a problem.  The only way to be safe is to mark such static variables as volatile.

    The attribute has no effect on functions defined within current compilation unit.

   
  * GCC has a new command line option: -fsplit-stack.

    This generates code to automatically split the stack before it overflows.  The resulting program has a discontiguous stack which can only overflow if the program is unable to allocate any more memory.  This is most useful when running threaded programs, as it is no longer necessary to calculate a good stack size to use for each thread.  This is currently only implemented for the i386 and x86_64 backends running GNU/Linux.

    When code compiled with -fsplit-stack calls code compiled without -fsplit-stack, there may not be much stack space available for the latter code to run.  If it is not possible to compile all the code, including libraries, with the  -fsplit-stack option then the linker can be used to fix things up automatically.  Support for this part of the feature however is currently only implemented in the GOLD linker in (not yet out) GNU binutils release 2.21.

    Functions can be annotated with the no_split attribute if they can run safely in a small amount of stack.  This can improve their runtime performance as then they will not need the prologue code that decides if it is necessary to split the stack.

   
  * GCC has another new command line option: -fplan9-extensions.

    This makes GCC accept some non-standard constructs used in Plan 9 code.  It enables -fms-extensions, permits passing pointers to structures with anonymous fields to functions which expect pointers to elements of the type of the field, and permits referring to anonymous fields declared using a typedef.

   
  * GCC has another new  command line option: -floop-flatten.

    This removes nested loops, transforming them into just one single loop.  This can be useful if it is possible to vectorize the entire loop.  It is not enabled by default at any optimization level however, so it is up to the programmer to decide when it is needed.

Cheers
  Nick

Comments

Profile

Deep Thought
nickclifton
nickclifton

Latest Month

March 2014
S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
Powered by LiveJournal.com
Designed by chasethestars