https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106457
--- Comment #8 from qinzhao at gcc dot gnu.org --- another testing case failed with the current array_at_struct_end_p is: gcc/testsuite/gcc.dg/torture/pr50067-1.c: 1 /* { dg-do run } */ 2 3 /* Make sure data-dependence analysis does not compute a bogus 4 distance vector for the different sized accesses. */ 5 6 extern int memcmp(const void *, const void *, __SIZE_TYPE__); 7 extern void abort (void); 8 short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 , 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; 9 short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, }; 10 int main() 11 { 12 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 13 int i; 14 if (sizeof (short) == 2) 15 { 16 for (i = 0; i < 32; ++i) 17 (*((unsigned short(*)[32])&a[0]))[i] = (*((char(*)[32])&a[0]))[i+8]; 18 if (memcmp (&a, &b, sizeof (a)) != 0) 19 abort (); 20 } 21 #endif 22 return 0; 23 } In the above, the array ref at line 17: (*((char(*)[32])&a[0]))[i+8] was identified as TRUE by the current array_at_struct_end_p: 12690 if (TREE_CODE (ref) == ARRAY_REF (gdb) call debug_tree(ref) <array_ref 0xfffff57a2b50 type <integer_type 0xfffff57d03f0 char public unsigned QI size <integer_cst 0xfffff56c0f00 constant 8> unit-size <integer_cst 0xfffff56c0f18 constant 1> align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0xfffff57d03f0 precision:8 min <integer_cst 0xfffff56c0f60 0> max <integer_cst 0xfffff56c0f48 255> pointer_to_this <pointer_type 0xfffff57d40f8>> arg:0 <mem_ref 0xfffff59fe3d0 type <array_type 0xfffff5994d70 type <integer_type 0xfffff57d03f0 char> BLK size <integer_cst 0xfffff56c1170 constant 256> unit-size <integer_cst 0xfffff56c1260 constant 32> align:8 warn_if_not_align:0 symtab:0 alias-set 0 canonical-type 0xfffff5994d70 domain <integer_type 0xfffff5994b78> pointer_to_this <pointer_type 0xfffff5994e18>> arg:0 <addr_expr 0xfffff56dbbe0 type <pointer_type 0xfffff5994ec0> constant arg:0 <var_decl 0xfffff5770ea0 a>> arg:1 <integer_cst 0xfffff56c7c08 constant 0> /home/opc/Work/GCC/latest_gcc/gcc/testsuite/gcc.dg/torture/pr50067-1.c:17:42 start: /home/opc/Work/GCC/latest_gcc/gcc/testsuite/gcc.dg/torture/pr50067-1.c:17:41 finish: /home/opc/Work/GCC/latest_gcc/gcc/testsuite/gcc.dg/torture/pr50067-1.c:17:63> arg:1 <ssa_name 0xfffff57612d8 type <integer_type 0xfffff57d05e8 int sizes-gimplified public SI size <integer_cst 0xfffff56c1050 constant 32> unit-size <integer_cst 0xfffff56c1068 constant 4> align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0xfffff57d05e8 precision:32 min <integer_cst 0xfffff56c1008 -2147483648> max <integer_cst 0xfffff56c1020 2147483647> pointer_to_this <pointer_type 0xfffff57d1a40>> visited def_stmt _1 = i_13 + 8; version:1 ptr-info 0xfffff59fee20> /home/opc/Work/GCC/latest_gcc/gcc/testsuite/gcc.dg/torture/pr50067-1.c:17:64 start: /home/opc/Work/GCC/latest_gcc/gcc/testsuite/gcc.dg/torture/pr50067-1.c:17:41 finish: /home/opc/Work/GCC/latest_gcc/gcc/testsuite/gcc.dg/torture/pr50067-1.c:17:68> ....(gdb) n 12801 return true; (gdb)