Is there any optimization happening during compile time?
There are many, but if you touch the array, the whole array will be there.
Is the compiler (I use gcc at the moment) smart enough to realize that only c[0] is used?
No, the compiler is not a programmer. It is programmer's job. Also If you use a reference to this array the compiler doe not why. You may not use the array at all in your code - but it can be used as a DMA buffer for example.
Is the operating system (name one) smart enough to not waste the memory?
It is not related to OS or bare metal. OS does not deal with static storage duration objects
When I code for embedded microcontrollers, is there any difference to running this program on another OS (memory-wise)?
No.
You just presented bad programming pattern leading to unnecessary wast3e of memory.