This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Aliasing: look through pointer's def stmt


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  <marc.glisse@inria.fr>

gcc/
	* 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.

--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]