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

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
Also this one shows the problem: -fdbg-cnt=ipa_cp_bits:10460-10461.

If I see correctly the function body:
lto-dump -dump-body=addr_to_index nir_lower_io.c.o
Gimple Body of Function: addr_to_index
addr_to_index (struct nir_builder * b, struct nir_ssa_def * addr,
nir_address_format addr_format)
{
  unsigned int c;

  <bb 2> [local count: 1073741824]:
  if (addr_format_3(D) == 3)
    goto <bb 3>; [20.24%]
  else
    goto <bb 4>; [79.76%]

  <bb 3> [local count: 217325344]:
  c = 0;
  _9 = nir_swizzle (b_5(D), addr_6(D), &c, 1);
  c ={v} {CLOBBER};
  goto <bb 7>; [100.00%]

  <bb 4> [local count: 856416481]:
  if (addr_format_3(D) == 4)
    goto <bb 5>; [100.00%]
  else
    goto <bb 6>; [0.00%]

  <bb 5> [local count: 856416481]:
  _8 = nir_channels (b_5(D), addr_6(D), 3);
  goto <bb 7>; [100.00%]

  <bb 6> [count: 0]:
  __builtin_unreachable ();

  <bb 7> [local count: 1073741824]:
  # _1 = PHI <_9(3), _8(5)>
  return _1;

}

addr_format (aka param 2) is either 3 or 4.
3 = 0x011
4 = 0x100

so mask 6 = 0x110 is wrong as first bit is not constant.
@Martin: Am I right?

Reply via email to