public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108599] [12 Regression] Incorrect code generation newer intel architectures Date: Fri, 10 Feb 2023 17:46:16 +0000 [thread overview] Message-ID: <bug-108599-4-PFKxqsXOAz@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108599-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108599 --- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:7d7f275ebe7295264a0406876c0670e25a50169a commit r12-9147-g7d7f275ebe7295264a0406876c0670e25a50169a Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Jan 31 10:12:19 2023 +0100 i386: Fix up ix86_convert_const_wide_int_to_broadcast [PR108599] The following testcase is miscompiled. The problem is that during RTL DSE we see a V4DI register is being loaded { 16, 16, 0, 0 } value and DSE mostly works in terms of scalar modes, so it calls movoi to set an OImode REG to (const_wide_int 0x100000000000000010) and ix86_convert_const_wide_int_to_broadcast thinks it can compute that value by broadcasting DImode 0x10. While it is true that for TImode result the broadcast could be used, for OImode/XImode it can't be, because all but the lowest 2 HOST_WIDE_INTs aren't present (so are 0 or -1 depending on sign), not 0x10 in this case. The function checks if the least significant HOST_WIDE_INT elt of the CONST_WIDE_INT is broadcastable from QI/HI/SI/DImode and then /* Check if OP can be broadcasted from VAL. */ for (int i = 1; i < CONST_WIDE_INT_NUNITS (op); i++) if (val != CONST_WIDE_INT_ELT (op, i)) return nullptr; That is needed of course, but nothing checks that CONST_WIDE_INT_NUNITS (op) isn't too small for the mode in question. I think if op would be 0 or -1, it ought to be never CONST_WIDE_INT, but CONST_INT and so we can just punt whenever the number of CONST_WIDE_INT elts is not the expected one. 2023-01-31 Jakub Jelinek <jakub@redhat.com> PR target/108599 * config/i386/i386-expand.cc (ix86_convert_const_wide_int_to_broadcast): Return nullptr if CONST_WIDE_INT_NUNITS (op) times HOST_BITS_PER_WIDE_INT isn't equal to bitsize of mode. * gcc.target/i386/avx2-pr108599.c: New test. (cherry picked from commit 963315a922e228c4f6853826666151fc540f111a)
next prev parent reply other threads:[~2023-02-10 17:46 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-30 13:18 [Bug c++/108599] New: Incorrect code generation newer intel architectures for gcc 12 and 13 balder at yahooinc dot com 2023-01-30 13:20 ` [Bug c++/108599] " balder at yahooinc dot com 2023-01-30 13:32 ` [Bug target/108599] " balder at yahooinc dot com 2023-01-30 13:49 ` [Bug target/108599] [12/13 Regression] Incorrect code generation newer intel architectures jakub at gcc dot gnu.org 2023-01-30 14:00 ` jakub at gcc dot gnu.org 2023-01-30 14:10 ` jakub at gcc dot gnu.org 2023-01-30 14:31 ` jakub at gcc dot gnu.org 2023-01-30 15:17 ` rguenth at gcc dot gnu.org 2023-01-30 15:19 ` jakub at gcc dot gnu.org 2023-01-31 9:12 ` cvs-commit at gcc dot gnu.org 2023-01-31 9:14 ` [Bug target/108599] [12 " jakub at gcc dot gnu.org 2023-02-09 11:54 ` balder at yahooinc dot com 2023-02-09 12:02 ` jakub at gcc dot gnu.org 2023-02-10 17:46 ` cvs-commit at gcc dot gnu.org [this message] 2023-02-10 18:01 ` jakub 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-108599-4-PFKxqsXOAz@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).