public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "philipp.gschwandtner at uibk dot ac.at" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/64689] New: tree-vectorize generates wrong code with inlined function - minimum working example included
Date: Tue, 20 Jan 2015 13:32:00 -0000	[thread overview]
Message-ID: <bug-64689-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 64689
           Summary: tree-vectorize generates wrong code with inlined
                    function - minimum working example included
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: philipp.gschwandtner at uibk dot ac.at

Created attachment 34500
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34500&action=edit
minimum working example

The tree vectorizer in gcc 4.7-4.9 appears to generate semantically incorrect
code for the particular case clarified in the attached minimum working example.
gcc 4.6.3 does not show this issue. In gcc 4.7.3 only one of the checks fails,
in gcc 4.8.3 and 4.9.2 both of them fail (as these versions also seem to
recognize case A as vectorizable).

Testing was performed on an Intel Xeon E5-2699 v3 Haswell CPU running a
3.10.0-123.13.1.el7.x86_64 Linux kernel.

Compile with:

gcc test.c -o test -O3 -std=c99 -pedantic -Wall -Wextra -fwrapv
-fno-strict-aliasing

Expected output (equals gcc 4.6.3 output):

Checking case A:
EQUAL!
Checking case B:
EQUAL!

Actual output (for gcc 4.8.3 and 4.9.2):

Checking case A:
NOT EQUAL!
C1:
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
C2:
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
Checking case B:
NOT EQUAL!
C1:
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
   -2     0i,    -2     0i,    -2     0i,    -2     0i, 
C2:
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 
   -1     0i,    -1     0i,    -1     0i,    -1     0i, 

Above output is produced when compiled with gcc 4.9.2 and 4.8.3. For gcc 4.7.3
the check for case A succeeds while the check for case B still fails.


             reply	other threads:[~2015-01-20 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 13:32 philipp.gschwandtner at uibk dot ac.at [this message]
2015-01-20 14:10 ` [Bug tree-optimization/64689] " trippels at gcc dot gnu.org
2015-01-21  9:33 ` philipp.gschwandtner at uibk dot ac.at
2015-01-21  9:38 ` trippels 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-64689-4@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).