gccint: GENERIC
1
1 11 GENERIC
1 **********
1
1 The purpose of GENERIC is simply to provide a language-independent way
1 of representing an entire function in trees. To this end, it was
1 necessary to add a few new tree codes to the back end, but almost
1 everything was already there. If you can express it with the codes in
1 'gcc/tree.def', it's GENERIC.
1
1 Early on, there was a great deal of debate about how to think about
1 statements in a tree IL. In GENERIC, a statement is defined as any
1 expression whose value, if any, is ignored. A statement will always
1 have 'TREE_SIDE_EFFECTS' set (or it will be discarded), but a
1 non-statement expression may also have side effects. A 'CALL_EXPR', for
1 instance.
1
1 It would be possible for some local optimizations to work on the
1 GENERIC form of a function; indeed, the adapted tree inliner works fine
1 on GENERIC, but the current compiler performs inlining after lowering to
1 GIMPLE (a restricted form described in the next section). Indeed,
1 currently the frontends perform this lowering before handing off to
1 'tree_rest_of_compilation', but this seems inelegant.
1
Menu