In the following example, ss should be constant propagated, but gcc does not do it.
static int ss = 0;
ss = 10;
This need super powerful IPA based call clobberness. Basically we need to detect there is only one value that ss can hold inside foo even with the call to bar, that is a hard problem really.
and it can be modified by an extern function, just it will be the same value as it was at the point bar was called.
Silly bug. bar can call back any function in ss's module.