public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "maister at archlinux dot us" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60276] New: -O3 autovectorizer breaks on a particular loop
Date: Wed, 19 Feb 2014 19:53:00 -0000	[thread overview]
Message-ID: <bug-60276-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 60276
           Summary: -O3 autovectorizer breaks on a particular loop
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: maister at archlinux dot us

Created attachment 32174
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32174&action=edit
Reduced testcase

GCC 4.8.2 with -O3 breaks a certain loop I'm compiling. Disabling the
vectorizer with -fno-tree-vectorize fixes the issue, as well as compiling with
-O2.

I've reduced the problem to a small test case which is attached as legall.c.

Distro: Arch Linux x86_64
gcc -v: 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.8-20140206/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --disable-cloog-version-check --enable-lto
--enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu
--disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 4.8.2 20140206 (prerelease) (GCC)

Miscompile: gcc -o legall legall.c -std=gnu99 -O3
Working: gcc -o legall legall.c -std=gnu99 -O3 -fno-tree-vectorize

Expected output:
(0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17)
(18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) (31) (32) (33)
(34) (35) (36) (37) (38) (39) (40) (41) (42) (43) (44) (45) (46) (47) (48)

Wrong output by -O3:
(0) (1) (2) (2) (4) (3) (6) (4) (8) (5) (10) (6) (12) (7) (14) (8) (16) (17)
(18) (10) (20) (11) (22) (12) (24) (13) (26) (14) (28) (15) (30) (16) (32) (33)
(34) (35) (36) (37) (38) (39) (40) (41) (42) (43) (44) (45) (46) (47) (48)


             reply	other threads:[~2014-02-19 19:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 19:53 maister at archlinux dot us [this message]
2014-02-20 10:24 ` [Bug tree-optimization/60276] [4.7/4.8 Regression] " rguenth at gcc dot gnu.org
2014-02-20 11:53 ` [Bug tree-optimization/60276] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
2014-02-20 12:00 ` rguenth at gcc dot gnu.org
2014-02-20 12:30 ` rguenth at gcc dot gnu.org
2014-02-20 12:56 ` rguenth at gcc dot gnu.org
2014-02-20 13:03 ` mpolacek at gcc dot gnu.org
2014-02-20 15:13 ` rguenth at gcc dot gnu.org
2014-02-21 13:19 ` [Bug tree-optimization/60276] [4.7/4.8 " rguenth at gcc dot gnu.org
2014-02-21 13:19 ` [Bug tree-optimization/60276] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
2014-02-25 12:43 ` [Bug tree-optimization/60276] [4.7/4.8 " rguenth at gcc dot gnu.org
2014-03-06  8:24 ` [Bug tree-optimization/60276] [4.7 " jakub at gcc dot gnu.org
2014-06-12 13:35 ` rguenth at gcc dot gnu.org
2014-09-03  9:02 ` rguenth at gcc dot gnu.org
2024-05-13 12:55 ` cvs-commit 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-60276-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).