It seems like it would not be hard for the optimizer to generate the
same
object code from this source code:
int x[] = { 3, 6, 9 };
int y = x[1];
as it does from this source code:
int x[] = { 3, 6, 9 };
int y = 6;
But it tried two compilers, with optimization enabled, and both
generated
"pre-main" executable code to initialize y (when it's assinged from
x[1]).
Anyone seen a compiler that does optimize out builtin [] in
initializers?
Or, anyone know why it is hard/bad to optimize [] out?