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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 45401
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45401&action=edit
VN patch

Turns f() into just

  <bb 2> [local count: 1073741824]:
  _3 = &MEM[(struct basic_string *)s_2(D)].D.18989._M_local_buf;
  MEM[(struct _Alloc_hider *)s_2(D)]._M_p = _3;
  MEM[(size_type *)s_2(D) + 8B] = 0;
  MEM[(char_type &)s_2(D) + 16] = 0;
  if (_3 != "hello")
    goto <bb 3>; [75.00%]
  else
    goto <bb 4>; [25.00%]

  <bb 3> [local count: 805306369]:
  __builtin_memcpy (_3, "hello", 5);
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 134217728]:
  __builtin_memcpy ("hello", &MEM[(void *)"hello" + 5B], 5);

  <bb 5> [local count: 1073741824]:
  MEM[(size_type *)s_2(D) + 8B] = 5;
  MEM[(char_type &)s_2(D) + 21] = 0;
  return s_2(D);

Reply via email to