------------------------------- a1ve Expression and Assignments ------------------------------- Input Program | GIMPLE dump ----------------------------------------+--------------------------------- 1 int N; | 2 void main() | 3 { | 4 |main () 5 |{ 6 int a, b; | 7 int c = 2; | 8 int x; | 9 | int N.0; 10 | int D.1593; 11 | int D.1594; 12 | int N.1; 13 | int a; 14 | int b; 15 | int c; 16 | int x; 17 | 18 int c = 2; | 19 | c = 2; 20 a = b; | 21 | a = b; 22 x = 5; | 23 | x = 5; 24 c = a + b; | 25 | c = a + b; 26 x = N * 2; | 27 | N.0 = N; 28 | x = N.0 * 2; 29 c = a * 2 + b * 3; | 30 | D.1593 = a * 2; 31 | D.1594 = b * 3; 32 | c = D.1593 + D.1594; 33 N = c + x; | 34 | N.1 = c + x; 35 | N = N.1; 36 } | 37 |} 38 | 39 | 1 (a) Multi-variable declarations are split-up individually (e.g. line 6 in the input program above becomes lines 13 and 14 in the GIMPLE.) (b) Initialized declarations are split into declaration and separate code for assignment (e.g. line 7 in input becomes line 15 and 19 in GIMPLE.) (c) There is no declaration for global variables. They are used directly. 2 Constant and variable assignments appear as they are. Simple expressions appear directly for local variables, but for globals a temporary variable (e.g. N.0) is introduced because global variables are treated as memory locations whose values should be read into (pseudo) registers such as N.0. Local variables are considered as registers by default. 3 Complex expressions are broken down to simple expressions having at most one operator. Temporary variables (e.g. D.1593) are introduced to store intermediate results. They are also treated as pseudo registers. 4 GIMPLE stores individual instructions similar to three-address-code in which an assignment may include at most one operator and three operands (result, lhs, rhs).