This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, PR55315] Don't assume a nonzero address plus a const is a nonzero address
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, rdsandiford at googlemail dot com
- Date: Mon, 19 Nov 2012 14:00:00 +0100
- Subject: Re: [PATCH, PR55315] Don't assume a nonzero address plus a const is a nonzero address
- References: <50A766EA.firstname.lastname@example.org> <email@example.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Nov 18, 2012 at 10:50:53AM +0000, Richard Sandiford wrote:
> Tom de Vries <Tom_deVries@mentor.com> writes:
> > 2012-11-17 Tom de Vries <firstname.lastname@example.org>
> > PR rtl-optimization/55315
> > * rtlanal.c (nonzero_address_p): Don't assume a nonzero address plus a
> > const is a nonzero address.
> > * gcc.target/mips/pr55315.c: New test.
> OK, thanks.
I think this is just papering over the problem that we don't distinguish
between pointer and integer arithmetics at RTL level (yeah, there is
REG_POINTER, but can we take it as guaranteed that integer arithmetics
is performed without REG_POINTER while pointer arithmetics with them?),
but in many places in RTL we just assume pointer arithmetics rules.
The above assumption that nonzero_address_p plus constant is nonzero
should be fine assumption in pointer arithmetics, so are many aliasing
assumptions, but they aren't valid for integer arithmetics. We have several
open PRs for this I believe.