Strange problem - need unused variable to make (Blink like) sketch run

Interesting. I would expect the compiler to optimize those statements out of existence, since assigning led a value and incrementing it never does anything useful.