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] Fix PR21082 for C++


On 4/24/05, Richard Henderson <rth@redhat.com> wrote:
> On Sun, Apr 24, 2005 at 07:57:35PM +0200, Richard Guenther wrote:
> > While this would be possible, I fail to see the advantage of doing this.
> > You will end up in (ptrdiff_t)((domain_t)i - (domain_t)j) instead of
> > (ptrdiff_t)i - (ptrdiff_t)j.  Are you concerned about correctness or about
> > more folding oportunities here?
> 
> Conceptual correctness.  I don't like the idea of multiplying pointers.

Well, I neither see pointers nor multiplication involved here ;)  The difference
&a[i] - &a[j] is of signed integer type ptrdiff_t (which should match ssize_t
which is the default TYPE_DOMAIN).  Roger pointed out to me that other
parts check TYPE_DOMAIN before accessing it (for being anal), is TYPE_DOMAIN
guaranteed to exist?  If so, I'll prepare a followup-patch to cast to
TYPE_DOMAIN
for applying the MINUS_EXPR and cast the result to the type of the original
expression.

Thanks,
Richard.


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