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/61680] [4.8 Regression] vectorization gives wrong answer for sandybridge target
Date: Tue, 09 Sep 2014 14:03:00 -0000	[thread overview]
Message-ID: <bug-61680-4-NovAo1kj3x@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61680-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|4.10.0                      |5.0

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
For 4.8 we can't backport the patch as group analysis and dependence analysis
are still the wrong way around.  A simple

Index: gcc/tree-vect-data-refs.c
===================================================================
--- gcc/tree-vect-data-refs.c   (revision 215073)
+++ gcc/tree-vect-data-refs.c   (working copy)
@@ -2307,6 +2307,17 @@ vect_analyze_group_access (struct data_r

       while (next)
         {
+         /* Check that there is no load-store dependencies for this loads
+            to prevent a case of load-store-load to the same location.  */
+         if (GROUP_READ_WRITE_DEPENDENCE (vinfo_for_stmt (next))
+             || GROUP_READ_WRITE_DEPENDENCE (vinfo_for_stmt (prev)))
+           {
+             if (dump_enabled_p ())
+               dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, 
+                                "READ_WRITE dependence in interleaving.");
+             return false;
+           }
+
           /* Skip same data-refs.  In case that two or more stmts share
              data-ref (supported only for loads), we vectorize only the first
              stmt, and the rest get their vectorized loads from the first
@@ -2323,17 +2334,6 @@ vect_analyze_group_access (struct data_r
                   return false;
                 }

-              /* Check that there is no load-store dependencies for this loads
-                 to prevent a case of load-store-load to the same location. 
*/
-              if (GROUP_READ_WRITE_DEPENDENCE (vinfo_for_stmt (next))
-                  || GROUP_READ_WRITE_DEPENDENCE (vinfo_for_stmt (prev)))
-                {
-                  if (dump_enabled_p ())
-                    dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, 
-                                     "READ_WRITE dependence in
interleaving.");
-                  return false;
-                }
-
               /* For load use the same data-ref load.  */
               GROUP_SAME_DR_STMT (vinfo_for_stmt (next)) = prev;


will regress testcases in vect.exp.

Like with two other 4.8 vectorizer miscompiles it's hard to fix them without
turning the vectorizer upside down (aka backport most of the re-org
from GCC 4.9).


  parent reply	other threads:[~2014-09-09 14:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-61680-4@http.gcc.gnu.org/bugzilla/>
2014-07-03  9:17 ` [Bug fortran/61680] " mikpelinux at gmail dot com
2014-07-03 10:20 ` [Bug tree-optimization/61680] [4.8/4.9/4.10 Regression] " dominiq at lps dot ens.fr
2014-07-03 10:45 ` jakub at gcc dot gnu.org
2014-07-03 10:51 ` jakub at gcc dot gnu.org
2014-07-03 11:51 ` jakub at gcc dot gnu.org
2014-07-03 12:49 ` jakub at gcc dot gnu.org
2014-07-03 13:28 ` jakub at gcc dot gnu.org
2014-07-07 11:08 ` rguenth at gcc dot gnu.org
2014-07-08  9:00 ` rguenth at gcc dot gnu.org
2014-07-08 11:05 ` rguenth at gcc dot gnu.org
2014-07-08 11:09 ` [Bug tree-optimization/61680] [4.8 " rguenth at gcc dot gnu.org
2014-09-09 14:03 ` rguenth at gcc dot gnu.org [this message]
2014-12-10 13:02 ` rguenth at gcc dot gnu.org
2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-06-23  8:53 ` 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-61680-4-NovAo1kj3x@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).