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: [PATCH, PR55315] Don't assume a nonzero address plus a const is a nonzero address


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  <tom@codesourcery.com>
> >
> > 	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.

	Jakub


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