------- Comment #28 from dberlin at gcc dot gnu dot org 2006-08-27 21:09 ------- Subject: Re: [4.0/4.1/4.2 Regression] alias bug with cast and call clobbered
> Since we have never done that before, it does require new code. > And to answer what may be a followup, which is "why hasn't this broken anything else before", it iss because even though the clobbering question and the alias question are subtly different, the answers are almost always the same. It is only because we prune the local answers using TBAAthat we get different answers depending on context. If you exclude strict type-based rules, the answer to "what can foo clobber" in the example is the same as asking "what can the first argument of foo access in foo and its callees". Because of the type-based rules, we end up with a disconnect. It would be undefined to dereference the first argument of foo without casting it first. In effect, the strict-type rules allow you can take an unaliased pointer in a caller, and validly turn it back into an aliased pointer in the callee. In order to account for this, you need to build the sets without accounting for the type-based rules, and if you want to apply the type-based rules to clobbering, use them on a context-sensitive basis (IE at the point of dereference, determine what could be accessed, and propagate that back up through other functions to get the a better clobber answer). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28778