https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124358

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think the problem is in the gimplifier.
The C front-end produces:
*(int *) (ptr + ((sizetype) ((long unsigned int) i * 4) + (sizetype) j) * 4)

But that gimplifies into:
              _1 = (long unsigned int) i;
              _2 = _1 * 4;
              _3 = (sizetype) j;
              _4 = _2 + _3;
              _5 = _4 * 4;
              _6 = ptr + _5;
              k = (*_6)[0]; //              k = __MEM <int[4]> (_6)[0ul];


The only issue is `k = (*_6)[0];` is broken and incorrect here. It should have
just used __MEM <int>(_6)

Reply via email to