This is the mail archive of the gcc@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: how to modify gcc to compile a[b] differently


On Wed, Apr 1, 2015 at 12:20 AM, Gry Gunvor <gry.gunvor@gmail.com> wrote:
> I want to modify gcc 4.9.2 so that array subscripting expressions a[b]
> generate a new instruction/syscall foo(a, b) (that is, taking a and b
> as arguments) rather than just being turned into *(a+b).
>
> Further, I want accesses into multi-dimensional arrays a[b][c] to turn
> into foo(a, (b * row_size + c)) rather than *(a + b * row_size + c).
>
> Any help finding a simple and robust way to do this would be greatly
> appreciated.

You probably want to do this in the frontends.

Richard.

> Gry


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