+ {
+ /* Generally access paths are monotous in the size of object. The
+ exception are trailing arrays of structures. I.e.
+ struct a {int array[0];};
+ or
+ struct a {int array1[0]; int array[];};
+ Such struct has size 0 but accesses to a.array may have non-zero size.
+ In this case the size of TREE_TYPE (base1) is smaller than
+ size of TREE_TYPE (TREE_OPERNAD (base1, 0)).
+
+ Because we compare sizes of arrays just by sizes of their elements,
+ we only need to care about zero sized array fields here. */
+ if (TREE_CODE (base1) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (base1, 1))) == ARRAY_TYPE
+ && (!TYPE_SIZE (TREE_TYPE (TREE_OPERAND (base1, 1)))
+ || integer_zerop (TYPE_SIZE (TREE_TYPE (TREE_OPERAND (base1, 1)))))
+ && array_at_struct_end_p (base1))
+ {
+ gcc_checking_assert (!end_struct_ref1);
+ end_struct_ref1 = base1;
+ }
+ base1 = TREE_OPERAND (base1, 0);
+ }