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: [tree-ssa] PATCH to generate ARRAY_REFs to INDIRECT_REFs


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


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