public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/94482] [8/9/10 Regression] Inserting into vector with optimization enabled on x86 generates incorrect result
Date: Mon, 06 Apr 2020 12:59:33 +0000	[thread overview]
Message-ID: <bug-94482-4-tndefl2Ood@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94482-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94482

--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #19)
> gcc.dg/torture/pr52244.c ICEs on the generated
> 
>   VIEW_CONVERT_EXPR<union u_t>(u) = bar ();
> 
> since V_C_E on the LHS are generally unwanted (but Ada has them for
> aggregates
> just not in outermost position).  What's always possible on the LHS is
> to use a BIT_FIELD_REF.

So the issue here is that 'u' is a register, not that V_C_E on the LHS
are invalid.  And we don't have a "general" DECL_GIMPLE_REG_P we could
unset since that's just usd for complex and vector types.  Which means
we'd have to artifically set TREE_ADDRESSABLE on the replacement.  It
isn't grp_partial_lhs so SRA doesn't do that.

In the case of a call we can't move the V_C_E to the RHS so we'd
really need to keep the call and insert a compensation assignment.

  orig = bar ();
  u = VIEW_CONVERT <regtype> (orig);

but that doesn't work for a partial access since we're clobbering the
whole replacement here.  A BIT_FIELD_REF on the LHS for a _register_
is also not possible so the write to a part via an incompatible type
would represent itself as

  orig_full = VIEW_CONVERT <orig_type> (repl_full);
  <original stmt with partial write to orig_full>
  repl_full = VIEW_CONVERT <repl_type> (orig_full);

which of course makes this highly suboptimal (but at least correct which
is what we should focus on right now).

  parent reply	other threads:[~2020-04-06 12:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 22:40 [Bug target/94482] New: " evan@coeus-group.com
2020-04-04  9:36 ` [Bug target/94482] " marxin at gcc dot gnu.org
2020-04-04 17:33 ` evan@coeus-group.com
2020-04-04 21:44 ` ubizjak at gmail dot com
2020-04-04 21:50 ` ubizjak at gmail dot com
2020-04-05 14:44 ` marxin at gcc dot gnu.org
2020-04-05 14:46 ` marxin at gcc dot gnu.org
2020-04-05 21:08 ` evan@coeus-group.com
2020-04-05 22:19 ` evan@coeus-group.com
2020-04-06  6:35 ` marxin at gcc dot gnu.org
2020-04-06  6:47 ` jakub at gcc dot gnu.org
2020-04-06  6:55 ` marxin at gcc dot gnu.org
2020-04-06  7:14 ` jakub at gcc dot gnu.org
2020-04-06  7:20 ` rguenth at gcc dot gnu.org
2020-04-06  7:28 ` [Bug target/94482] [8/9/10 Regression] " jakub at gcc dot gnu.org
2020-04-06  7:29 ` marxin at gcc dot gnu.org
2020-04-06  7:30 ` jakub at gcc dot gnu.org
2020-04-06  8:32 ` rguenth at gcc dot gnu.org
2020-04-06  8:44 ` rguenth at gcc dot gnu.org
2020-04-06  8:54 ` rguenth at gcc dot gnu.org
2020-04-06  9:32 ` rguenth at gcc dot gnu.org
2020-04-06 12:59 ` rguenth at gcc dot gnu.org [this message]
2020-04-06 13:40 ` [Bug tree-optimization/94482] " jamborm at gcc dot gnu.org
2020-04-06 16:36 ` rguenth at gcc dot gnu.org
2020-04-09 12:43 ` cvs-commit at gcc dot gnu.org
2020-04-09 12:46 ` [Bug tree-optimization/94482] [8/9 " jamborm at gcc dot gnu.org
2020-04-10  3:39 ` evan@coeus-group.com
2020-04-11  5:51 ` cvs-commit at gcc dot gnu.org
2020-04-21 12:22 ` cvs-commit at gcc dot gnu.org
2020-04-21 15:42 ` cvs-commit at gcc dot gnu.org
2020-04-21 16:37 ` jamborm 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-94482-4-tndefl2Ood@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: link
Be 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).