Summary

Status

What's Currently Broken

How to play

Checkout the lto branch.

Configure with--enable-languages=lto --disable-bootstrap

Note that currently, the -flto flag always enables -O2. This will be fixed later.

Issues left to address

If you are interested in working on any of these issues, please add your name to the item you are interested in and send mail to the list.

Tasks

Summary of CALL_EXPR changes

tree build_call_list (enum tree_code code, tree return_type, tree fn, tree arglist)
tree build_call_nary (enum tree_code code, tree return_type, tree fn, int nargs, ...)
tree build_call_valist (enum tree_code code, tree return_type, tree fn, int nargs, va_list args)
tree build_call_array (enum tree_code code, tree return_type, tree fn, int nargs, tree* args)

CALL_EXPR_FN (exp)
CALL_EXPR_STATIC_CHAIN (exp)
CALL_EXPR_ARG0 (exp)   /* etc, up to CALL_EXPR_ARG2 */
CALL_EXPR_ARG (exp, i)

    call_expr_arg_iterator iter;
    tree arg;
    FOR_EACH_CALL_EXPR_ARG (arg, iter, exp)
      /* ARG is bound to successive arguments of EXP */
      ...;

To Do List for Additional Memory Use Reductions

* The C and C++ Parsers should be changed to store arguments in a stack-allocated array instead of building a temporary TREE_LIST as calls are parsed. Make the corresponding change to both the C and C++ versions of build_function_call, and fix all the other callers. The C++ overloading resolution functions that now have an arglist parameter also need to be modified to take an array. (Conceptually simple change, potentially large memory savings since it affects all calls seen by the parser.)

* Fix format argument checking in c-format.c to work directly on the argument array that is now passed in, instead of converting it to a list. (Minor savings, only affects calls to format.)

* Get rid of the complexity slot from struct tree_exp. (Potentially large savings since it affects all expression nodes.)

* Share instances TREE_VEC containing parameter lists. Currently, it's possible that gcc has two instances of TREE_VEC representing the same parameter list. See build_function_type' and build_function_type_list'. We could start out with avoiding duplicate instances of TREE_VEC identical to void_vec_node.

* Look around in the parsers for other language constructs where temporary TREE_LISTs are being constructed and then discarded. There seems to be a lot of list-building going on while parsing ObjC and C++ constructs, in particular.

* The Java parser needs a lot of work as it is still constructing TREE_LISTs for CALL_EXPRs in many places. Java people are reportedly already doing some unrelated major restructuring of this code so check with them first.

None: LinkTimeOptimization (last edited 2008-01-18 22:58:46 by DiegoNovillo)