public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61068] New: -O3 generates bad code (when tree-vectorize or inline-functions is on)
@ 2014-05-05 16:07 wence at gmx dot li
  2014-05-05 16:40 ` [Bug c/61068] " wence at gmx dot li
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: wence at gmx dot li @ 2014-05-05 16:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61068
           Summary: -O3 generates bad code (when tree-vectorize or
                    inline-functions is on)
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wence at gmx dot li

Created attachment 32738
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32738&action=edit
preprocessed source

The attached program segfaults at runtime when compiled with -O3.  If I compile
with either -fno-tree-vectorize or -fno-inline then the output is correct
(verified externally, this is a cut down example).

Note that if I split the increments into A[j][k] and A[(j+3)][(k+3)] into
separate loops, then the segfault also goes away.

I am currently building 4.9 to see if the problem still exists there.

Compilation command:

gcc-4.8 -v -std=c99 -O3  foo.c  -save-temps

-v output:

Using built-in specs.
COLLECT_GCC=gcc-4.8
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/lto-wrapper
Target: x86_64-apple-darwin13.0.0
Configured with: ../configure --build=x86_64-apple-darwin13.0.0
--prefix=/usr/local/Cellar/gcc48/4.8.2 --enable-languages=c,c++,objc,obj-c++
--program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4
--with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08
--with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011
--with-system-zlib --enable-version-specific-runtime-libs
--enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release
--enable-lto --disable-werror --enable-plugin --disable-nls --disable-multilib
Thread model: posix
gcc version 4.8.2 (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.1' '-v' '-std=c99' '-O3'
'-save-temps' '-mtune=core2'
 /usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/cc1
-E -quiet -v -D__DYNAMIC__ foo.c -fPIC -mmacosx-version-min=10.9.1 -mtune=core2
-std=c99 -O3 -fpch-preprocess -o foo.i
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.2/include"
ignoring nonexistent directory
"/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/../../../../x86_64-apple-darwin13.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/include
 /usr/local/include

/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.1' '-v' '-std=c99' '-O3'
'-save-temps' '-mtune=core2'
 /usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/cc1
-fpreprocessed foo.i -fPIC -quiet -dumpbase foo.c -mmacosx-version-min=10.9.1
-mtune=core2 -auxbase foo -O3 -std=c99 -version -o foo.s
GNU C (GCC) version 4.8.2 (x86_64-apple-darwin13.0.0)
    compiled by GNU C version 4.8.2, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (GCC) version 4.8.2 (x86_64-apple-darwin13.0.0)
    compiled by GNU C version 4.8.2, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 077b529d6cfe035508c45a2f30143407
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.1' '-v' '-std=c99' '-O3'
'-save-temps' '-mtune=core2'
 as -arch x86_64 -force_cpusubtype_ALL -o foo.o foo.s
COMPILER_PATH=/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/:/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/:/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/:/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/:/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/
LIBRARY_PATH=/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/:/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.1' '-v' '-std=c99' '-O3'
'-save-temps' '-mtune=core2'

/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/collect2
-dynamic -arch x86_64 -macosx_version_min 10.9.1 -weak_reference_mismatches
non-weak -o a.out
-L/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2
-L/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/../../..
foo.o -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 4.8.2
/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.9.1
-weak_reference_mismatches non-weak -o a.out
-L/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2
-L/usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/../../..
foo.o -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-236.4
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m
armv7em
Library search paths:
    /usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2
    /usr/local/Cellar/gcc48/4.8.2/lib
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-06-23  8:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-05 16:07 [Bug c/61068] New: -O3 generates bad code (when tree-vectorize or inline-functions is on) wence at gmx dot li
2014-05-05 16:40 ` [Bug c/61068] " wence at gmx dot li
2014-05-05 16:46 ` [Bug target/61068] " mpolacek at gcc dot gnu.org
2014-05-05 20:28 ` zsojka at seznam dot cz
2014-05-06  6:13 ` wence at gmx dot li
2014-05-06  8:53 ` [Bug tree-optimization/61068] [4.8 Regression] " rguenth at gcc dot gnu.org
2014-05-06  8:53 ` rguenth at gcc dot gnu.org
2014-05-06  9:22 ` jakub at gcc dot gnu.org
2014-05-06  9:25 ` rguenth at gcc dot gnu.org
2014-05-06 10:13 ` rguenth at gcc dot gnu.org
2014-05-22  9:03 ` rguenth at gcc dot gnu.org
2014-12-10 12:59 ` rguenth at gcc dot gnu.org
2014-12-19 13:31 ` jakub at gcc dot gnu.org
2015-06-23  8:52 ` rguenth at gcc dot gnu.org

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).