Since you apply sizeof to a variable-length array whose size is not completely known at compile time, the compiler must generate code to make it part at runtime.
gcc 4.6.3 high-level optimizers convert the code you specify in
scanf ("%d", &n); t12 = (long unsigned int) n; t13 = t12 * 4; __builtin_alloca (t13); t16 = (unsigned int) t12; t17 = t16 * 4; s18 = (int) t17; printf ("%d", s18);
Does this explain what is happening under the hood? (Donβt be distracted by the stupid amount of temporary variables β that the artifact of the program, which is in a static single assignment , is formed at the point where I asked for an intermediate code dump.)
zwol Apr 09 '12 at 19:09 2012-04-09 19:09
source share