This is the mail archive of the
mailing list for the GCC project.
Re: Aliasing: look through pointer's def stmt
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 26 Oct 2013 19:07:21 +0200 (CEST)
- Subject: Re: Aliasing: look through pointer's def stmt
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1310250707430 dot 14734 at stedding dot saclay dot inria dot fr> <526A0269 dot 8030407 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1310250809590 dot 4165 at laptop-mg dot saclay dot inria dot fr> <CAFiYyc27=sN1itn+N09rpmm8tWGt-Khu7oASLd0ODsdZh=ofzw at mail dot gmail dot com> <CAFiYyc2EtayY0tiW1pz4t-zf0uVC24UcF5s7yaUrY3f7_jxoVg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1310251123350 dot 8620 at laptop-mg dot saclay dot inria dot fr> <CAFiYyc2WmH4WNZ7h8-8iC_6mSO50PdLNLxNzQOYZrYEvn1oQkQ at mail dot gmail dot com> <alpine dot DEB dot 2 dot 02 dot 1310251852480 dot 9786 at stedding dot saclay dot inria dot fr>
On Fri, 25 Oct 2013, Marc Glisse wrote:
On Fri, 25 Oct 2013, Richard Biener wrote:
you can followup with handling POINTER_PLUS_EXPR if you like.
Like this? (bootstrap+testsuite on x86_64-unknown-linux-gnu)
2013-10-26 Marc Glisse <firstname.lastname@example.org>
* tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Look for a
POINTER_PLUS_EXPR in the defining statement.
This has some issues with the type of the offsets. First, they might
overflow in some extreme cases (that could probably already happen without
the patch). But mostly, negative offsets are not supported. There is a
comment to that effect before ao_ref_init_from_ptr_and_size, and
ranges_overlap_p takes the offsets as unsigned HOST_WIDE_INT. Currently it
does indeed seem hard to produce a negative offset there, but handling
POINTER_PLUS_EXPR (definitely a good thing) would obviously change that.