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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-28
     Ever confirmed|0                           |1

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
The example you wrote in the bug report makes no sense: missing includes, and
with the includes added it optimizes to return 0. Downloading the one from
godbolt, we simplify it to:

int main() ()
{
  struct string_view D.32298;
  long unsigned int _15;

  <bb 2> [14.44%] [count: INV]:
  _15 = __builtin_strlen (&internal_buffer);
  MEM[(struct string_view *)&D.32298] = _15;
  MEM[(struct string_view *)&D.32298 + 8B] = &internal_buffer;
  __asm__ __volatile__("" :  : "i,r,m" D.32298 : "memory");
  return 0;
}

Indeed we don't seem to manage folding strlen there. I think there is a DUP
asking to transform the buffer into STRING_CST or something like that.

(btw, why do you use "g" for clang and not for gcc?)

Reply via email to