public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "congh at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60656] [4.8/4.9 regression] x86 vectorization produces wrong code
Date: Tue, 25 Mar 2014 19:41:00 -0000	[thread overview]
Message-ID: <bug-60656-4-g89J7XVZdz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60656-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60656

Cong Hou <congh at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |congh at google dot com

--- Comment #2 from Cong Hou <congh at google dot com> ---
This bug is caused by an optimization in GCC vectorizer that is not
implemented properly. When a reduction operation is vectorized, the
order of elements in vectors directly used in reduction does not
matter. In some cases the vectorizer may generate less code based on
this fact. GCC assigns a property named "vect_used_by_reduction" to
all vectors participating in reductions. However, vectors that are
indirectly used in reduction also have this property. For example,
consider the following three statements (all operands are vectors):

a = b op1 c;
d = a op2 e;
s1 = s0 op3 d;

Here assume the last statement is a reduction one, then a,b,c,d,e all
have the property "vect_used_by_reduction". However, if op2 is
different from op3, then a's element order can affect the final
result. GCC does not check this.


  parent reply	other threads:[~2014-03-25 19:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 16:02 [Bug tree-optimization/60656] New: " ppluzhnikov at google dot com
2014-03-25 18:09 ` [Bug tree-optimization/60656] " jakub at gcc dot gnu.org
2014-03-25 19:41 ` congh at google dot com [this message]
2014-03-25 20:03 ` jakub at gcc dot gnu.org
2014-03-25 20:12 ` congh at google dot com
2014-03-28 11:19 ` jakub at gcc dot gnu.org
2014-03-28 15:21 ` jakub at gcc dot gnu.org
2014-03-28 18:48 ` congh at google dot com
2014-04-09 12:25 ` jakub at gcc dot gnu.org
2014-04-09 12:28 ` [Bug tree-optimization/60656] [4.8 " jakub at gcc dot gnu.org
2014-04-16  8:52 ` bernd.edlinger at hotmail dot de
2014-04-16  8:56 ` jakub at gcc dot gnu.org
2014-05-22  9:07 ` rguenth at gcc dot gnu.org
2014-12-19 13:41 ` jakub at gcc dot gnu.org
2015-06-09 23:37 ` bernhard.kaindl at thalesgroup dot com
2015-06-10  9:01 ` rguenth at gcc dot gnu.org
2015-06-10 11:04 ` rguenth at gcc dot gnu.org
2015-06-10 13:51 ` 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-60656-4-g89J7XVZdz@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).