You running bare-metal? As you can't typically access the PMU directly from user space under Linux.
You should probably make "c" and/or a volatile, even at a low optimization level the compiler might eliminate your code otherwise.