https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90450
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Not exactly sure what happens, need to investigate. The testcase looks
> innocous enough at least ...
It's about 'd[f]' and 'd[0]' references. The former one is hashed in else
branch and the later
in true branch. These are then equal in mem_ref_hasher::equal as
operand_equal_p can return true
for these 2 array references.
1479 if (aor.max_size_known_p ()
1480 && aor.offset.is_constant (&offset)
1481 && aor.size.is_constant (&size)
1482 && aor.max_size.is_constant (&max_size)
1483 && size == max_size
1484 && (size % BITS_PER_UNIT) == 0
1485 /* We're canonicalizing to a MEM where TYPE_SIZE specifies
the
1486 size. Make sure this is consistent with the extraction.
*/
1487 && poly_int_tree_p (TYPE_SIZE (TREE_TYPE (*mem)))
1488 && known_eq (wi::to_poly_offset (TYPE_SIZE (TREE_TYPE
(*mem))),
1489 aor.size)
1490 && (mem_base = get_addr_base_and_unit_offset (aor.ref,
&mem_off)))
1491 {
1492 hash = iterative_hash_expr (ao_ref_base (&aor), 0);
1493 hash = iterative_hash_host_wide_int (offset, hash);
1494 hash = iterative_hash_host_wide_int (size, hash);
1495 }
1496 else
1497 {
1498 hash = iterative_hash_expr (aor.ref, 0);
1499 aor.max_size = -1;
1500 }