------- Comment #1 from rguenth at gcc dot gnu dot org 2009-02-06 10:09 ------- You get a warning issued by the frontend for the first case. The second case is not warned because we didn't prune buf fron ps points-to set. This is because while A has an alias set of 2, buf has alias set zero. And obviously 2 is a subset of zero (which is the only thing we can really test here), so we don't prune buf (even though it is not valid to access buf via A *).
This is a limitation of the C frontend which does not allow more precise representation of "lvalue of character type". -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39117