public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "daniel at eyoman dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108715] New: Infinite loop in the generated assembly with -Os when strlen is defined in the code Date: Wed, 08 Feb 2023 10:29:33 +0000 [thread overview] Message-ID: <bug-108715-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108715 Bug ID: 108715 Summary: Infinite loop in the generated assembly with -Os when strlen is defined in the code Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: daniel at eyoman dot com Target Milestone: --- Created attachment 54426 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54426&action=edit C file Hi, The attached source file is compiled on GCC 12.2.1 with the following command: gcc -save-temps -Wall -Wextra -Os strlen_bug.c -o strlen_bug The assembly file, obtained with objdump -d strlen_bug, shows that: - the for loop dealing with the length calculation has been removed by strlen - the strlen label jumps to itself - the program never ends If the strlen function is removed from the code, the problem doesn't occur. I wanted to attach the assembly and preprocessed files but I could attach only one.
next reply other threads:[~2023-02-08 10:29 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-08 10:29 daniel at eyoman dot com [this message] 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 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@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).