public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108715] Infinite loop in the generated assembly with -Os when strlen is defined in the code Date: Wed, 08 Feb 2023 12:37:02 +0000 [thread overview] Message-ID: <bug-108715-4-NYrzsma0Uv@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108715-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108715 --- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- While the strlen pattern recognition has been added later than memcpy/memset, it is really the same thing. With -ffreestanding which you are supposed to use when you are providing C library yourself (or parts thereof as in this case) they aren't recognized for years. Without -ffreestanding, -fno-tree-loop-distribute-patterns turns off those pattern recognitions. As mentioned in the other PR, while disabling pattern recognition of say memcpy within function named memcpy and similarly for strlen wouldn't be that hard (where currently without any of the above options we end up with tail recursion), there is always the case where say memcpy could be implemented by calling say memcpy_impl and only that one would contain the recognized pattern. Such indirect recursion would be much harder to deal with.
next prev parent reply other threads:[~2023-02-08 12:37 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-08 10:29 [Bug c/108715] New: " daniel at eyoman dot com 2023-02-08 10:30 ` [Bug c/108715] " daniel at eyoman dot com 2023-02-08 10:30 ` daniel at eyoman dot com 2023-02-08 10:32 ` daniel at eyoman dot com 2023-02-08 10:33 ` daniel at eyoman dot com 2023-02-08 10:34 ` daniel at eyoman dot com 2023-02-08 10:34 ` daniel at eyoman dot com 2023-02-08 10:38 ` daniel at eyoman dot com 2023-02-08 11:27 ` [Bug middle-end/108715] " pinskia at gcc dot gnu.org 2023-02-08 11:34 ` daniel at eyoman dot com 2023-02-08 11:38 ` jakub at gcc dot gnu.org 2023-02-08 12:22 ` daniel at eyoman dot com 2023-02-08 12:37 ` jakub at gcc dot gnu.org [this message] 2023-02-08 17:45 ` pinskia at gcc dot gnu.org 2023-02-08 17:48 ` jakub at gcc dot gnu.org 2023-02-08 17:52 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108715-4-NYrzsma0Uv@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).