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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If I replace all a[1] and a[0] with a in the testcase, then it works fine;
the thing is that dr_analyze_indices adds DR_ACCESS_FNS elements for each
handled_component_p level, so if we have a[0], it has DR_NUM_DIMENSIONS == 1 -
constant 0.  If we have ((struct S *)&a).g, it has also DR_NUM_DIMENSIONS == 1
- constant 32 - the bit offset of field g.  The problem is that in each case
these are counting something different, in one case it is offset into the
array, in the other case it is field bitoffset.  But, as operand_equal_p
returned non-zero, because it didn't compare the types, tree-data-ref.c thinks
both access fns count the same thing.
With single element arrays and/or fields that have the same size as the
containing struct/union the access fns can differ substantially.

Reply via email to