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 tree-optimization/104497] [11/12 Regression] Invalid gimple produced for (A?vect:vect)[i] Date: Mon, 14 Feb 2022 08:12:54 +0000 [thread overview] Message-ID: <bug-104497-4-w3mIDsxSxB@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104497-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104497 --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:3f10e0d50b5e3b3f64bc9a1a29177518d5f4468d commit r12-7222-g3f10e0d50b5e3b3f64bc9a1a29177518d5f4468d Author: Richard Biener <rguenther@suse.de> Date: Fri Feb 11 11:08:57 2022 +0100 middle-end/104497 - gimplification of vector indexing The following attempts to address gimplification of ... = VIEW_CONVERT_EXPR<int[4]>((i & 1) != 0 ? inv : src)[i]; which is problematic since gimplifying the base object ? inv : src produces a register temporary but GIMPLE does not really support a register as a base for an ARRAY_REF (even though that's not strictly validated it seems as can be seen at -O0). Interestingly the C++ frontend avoids this issue by emitting the following GENERIC instead: ... = (i & 1) != 0 ? VIEW_CONVERT_EXPR<int[4]>(inv)[i] : VIEW_CONVERT_EXPR<int[4]>(src)[i]; The proposed patch below fixes things up when using an rvalue as the base is OK by emitting a copy from a register base to a non-register one. The ?: as lvalue extension seems to be gone for C, C++ again unwraps the COND_EXPR in that case. 2022-02-11 Richard Biener <rguenther@suse.de> PR middle-end/104497 * gimplify.cc (gimplify_compound_lval): Make sure the base is a non-register if needed and possible. * c-c++-common/torture/pr104497.c: New testcase.
next prev parent reply other threads:[~2022-02-14 8:12 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-11 7:34 [Bug tree-optimization/104497] New: SEGV during GIMPLE pass: pre jbeulich at suse dot com 2022-02-11 7:50 ` [Bug tree-optimization/104497] " jbeulich at suse dot com 2022-02-11 7:57 ` pinskia at gcc dot gnu.org 2022-02-11 8:02 ` [Bug tree-optimization/104497] [11/12 Regression] Invalid gimple produced for (A?vect:vect)[i] pinskia at gcc dot gnu.org 2022-02-11 9:30 ` rguenth at gcc dot gnu.org 2022-02-11 10:00 ` rguenth at gcc dot gnu.org 2022-02-11 10:04 ` rguenth at gcc dot gnu.org 2022-02-11 10:15 ` rguenth at gcc dot gnu.org 2022-02-14 8:12 ` cvs-commit at gcc dot gnu.org [this message] 2022-02-14 8:46 ` [Bug tree-optimization/104497] [11 " rguenth at gcc dot gnu.org 2022-04-07 9:53 ` cvs-commit at gcc dot gnu.org 2022-04-07 9:54 ` rguenth 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-104497-4-w3mIDsxSxB@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).