This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] PATCH to generate ARRAY_REFs to INDIRECT_REFs
- From: Jason Merrill <jason at redhat dot com>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 20 Aug 2003 15:09:52 -0400
- Subject: Re: [tree-ssa] PATCH to generate ARRAY_REFs to INDIRECT_REFs
- References: <Pine.LNX.4.44.0308201311410.10196-100000@nondot.org>
On Wed, 20 Aug 2003 13:13:36 -0500 (CDT), Chris Lattner <sabre@nondot.org> wrote:
>> Several people have objected to the C/C++ frontends generating pointer
>> arithmetic rather than ARRAY_REFs when the array operand is an
>> INDIRECT_REF. The obvious fix doesn't seem to break anything.
>
> Are you certain that this does not break testcases like this (at -O2):
>
> int foo(char *ap) {
> return ap[1] == '-' && ap[2] == 0;
> }
My patch wouldn't affect this testcase, since ap does not have ARRAY_TYPE.
I think we eventually want to use ARRAY_REF for this situation, too, but
that will be a bit more involved.
Jason