public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gabravier at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94930] New: Failure to optimize out subvsi in expansion of __builtin_memcmp with 1 as the operand with -ftrapv Date: Sun, 03 May 2020 00:22:34 +0000 [thread overview] Message-ID: <bug-94930-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94930 Bug ID: 94930 Summary: Failure to optimize out subvsi in expansion of __builtin_memcmp with 1 as the operand with -ftrapv Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- int memcmp1(const void *s, const void *c) { return __builtin_memcmp(s, c, 1); } With -O3 -ftrapv, LLVM outputs this : memcmp1(void const*, void const*): # @memcmp1(void const*, void const*) movzx eax, byte ptr [rdi] movzx ecx, byte ptr [rsi] sub eax, ecx ret GCC outputs this : memcmp1(void const*, void const*): sub rsp, 8 movzx edi, BYTE PTR [rdi] movzx esi, BYTE PTR [rsi] call __subvsi3 add rsp, 8 ret
next reply other threads:[~2020-05-03 0:22 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-03 0:22 gabravier at gmail dot com [this message] 2020-05-03 14:45 ` [Bug tree-optimization/94930] " glisse at gcc dot gnu.org 2021-04-26 1:18 ` pinskia at gcc dot gnu.org 2021-12-23 5:14 ` 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-94930-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).