[tree-ssa] PATCH to generate ARRAY_REFs to INDIRECT_REFs

Jason Merrill jason@redhat.com
Wed Aug 20 19:09:00 GMT 2003


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



More information about the Gcc-patches mailing list