This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/79547] duplicate strlen calls with same argument not folded
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Feb 2017 11:45:52 +0000
- Subject: [Bug tree-optimization/79547] duplicate strlen calls with same argument not folded
- Auto-submitted: auto-generated
- References: <bug-79547-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79547
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> + /* Pure functions that return something not based on any object. */
> + case BUILT_IN_STRLEN:
> + /* We don't need to do anything here. No constraints are necessary
> + for the return value and call handling for pure functions is
> + special-cased in the alias oracle. */
> + return true;
> /* Trampolines are special - they set up passing the static
> frame. */
> case BUILT_IN_INIT_TRAMPOLINE:
>
>
> any other similar (pure/const) builtins?
strcmp, strncmp, strcasecmp, strncasecmp, memcmp, strchr, strrchr, index,
rindex?