I don't really like the use of volatile here. Do compilers really constant-fold that? Is it a bug or does the standard actually allow them to do that?