[Bug middle-end/87813] sprintf pass calling evrp at -O0 and setting global ranges which affect strnlen expansion

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 5 16:06:00 GMT 2018


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

--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Aldy Hernandez from comment #6)

I agree, but it's just a small subset of such cases.  There are many optimizing
transformations that GCC does at -O0 that affect the IL later on: calls to
library built-ins are folded into other library calls (strcpy to memcpy), or to
MEM_REFs (memcpy), or even to constants (strlen).  For example:

  int f (void)
  {
    return __builtin_strlen ("123");
  }


More information about the Gcc-bugs mailing list