[llvm-dev] [GSoC 2016] Better Alias Analysis By Default - Mid Term Summary

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 21 15:50:44 PDT 2016

On Tue, Jun 21, 2016 at 05:29:13PM -0500, Jia Chen via llvm-dev wrote:
> - [r271322] Remove aliasing relations between GEP pointers and GEP indices.
> Before this patch, CFL-AA will claim that a and b may-alias each other in
> the following codes:
> int a[10], b[10];
> a[N] = ...;
> b[N] = ...;
> This seemingly insane behavior was actually there to safeguard certain cases
> where people do crazy stuffs with pointer arithmetics. Later we figured out
> that those crazy behaviors were in fact UB and therefore we could drop
> support for it.

What exactly is the semantic justification here? I'm asking because
there are a number of crucial use cases for aliasing global arrayish
variables behind the compiler like linker sets. We had quite some fun in
NetBSD with newer GCC introducing breakage by exploiting UB in fun ways.
It would be nice to avoid breaking valid applications in system/embedded


More information about the llvm-dev mailing list