public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bdeyal at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/66263] New: Performance regression from gcc-4.8 and up (trivial sudoku program)
Date: Sat, 23 May 2015 17:46:00 -0000	[thread overview]
Message-ID: <bug-66263-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 66263
           Summary: Performance regression from gcc-4.8 and up (trivial
                    sudoku program)
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bdeyal at gmail dot com
  Target Milestone: ---

Created attachment 35605
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35605&action=edit
Preprocessed source file

I ran the attached simple program with gcc-4.6, 4.7, 4.8, 4.9 and 5.1

This is a simple brute force + recursion program that finds all the solutions
for a given sudoku board. My input file had about half a million different
solutions.

System is fedora 21 with gcc 4.9.2
All other compilers were built locally.

my compilation command line was:

$(CC) -Ofast -W -Wall -DNDEBUG src/sudoku.c -o bin/sudoku


Running time results
====================


gcc-4.6.4   0.483s
gcc-4.7.4   0.496s
gcc-4.8.4   0.749s
gcc-4.9.2   0.762s
gcc-5.1.0   0.776s


Files:
======
Attached preprocessed file to compile.

In addition here's the input file contents for solving:

- - - - - 1 - 3 -
- - 8 - - - - 7 5
- 1 - 9 - - - - -
- - 7 - - - - - 1
- - - 8 - 9 - - -
8 - - - 3 - - - -
- - - - - - - 9 -
9 2 - - - - 3 - -
- - - - - - - - -

to test you should run something like:

time ./sudoku --quiet < input_file.txt

where ./sudoku is the produced executable and input_file.txt is the sudoku
board from above.



Detailed compiler version and configure options:
================================================

$ gcc-4.6 -v
Using built-in specs.
COLLECT_GCC=gcc-4.6
COLLECT_LTO_WRAPPER=/opt/gcc46/libexec/gcc/x86_64-redhat-linux/4.6.4/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/gcc46 --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--enable-multilib --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++
--enable-plugin --enable-initfini-array --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.6.4 (GCC)


$ gcc-4.7 -v
Using built-in specs.
COLLECT_GCC=gcc-4.7
COLLECT_LTO_WRAPPER=/opt/gcc-4.7.4/libexec/gcc/x86_64-redhat-linux/4.7.4/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../gcc-4.7.4/configure --prefix=/opt/gcc-4.7.4
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,fortran --enable-plugin --enable-initfini-array
--disable-dssi --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.7.4 (GCC)


$ gcc-4.8 -v
Using built-in specs.
COLLECT_GCC=gcc-4.8
COLLECT_LTO_WRAPPER=/opt/gcc48/libexec/gcc/x86_64-redhat-linux/4.8.4/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/gcc48 --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--enable-multilib --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,fortran,go,lto --enable-plugin --enable-initfini-array
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.4 (GCC)


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --enable-multilib --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin
--enable-initfini-array --disable-libgcj
--with-isl=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC)


$ gcc-5.0 -v
Using built-in specs.
COLLECT_GCC=gcc-5.0
COLLECT_LTO_WRAPPER=/opt/gcc5/libexec/gcc/x86_64-redhat-linux/5.1.0/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/gcc5/ --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--enable-multilib --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,fortran,go,lto --enable-plugin --enable-initfini-array
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 5.1.0 (GCC)


             reply	other threads:[~2015-05-23 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-23 17:46 bdeyal at gmail dot com [this message]
2015-05-23 17:48 ` [Bug c/66263] " bdeyal at gmail dot com
2015-05-26 10:53 ` [Bug tree-optimization/66263] [4.8/4.9/5/6 Regression] " rguenth at gcc dot gnu.org
2015-05-27 22:15 ` bdeyal at gmail dot com
2015-06-23  8:27 ` rguenth at gcc dot gnu.org
2015-06-26 20:18 ` [Bug tree-optimization/66263] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:39 ` jakub at gcc dot gnu.org
2015-06-30 11:02 ` 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-66263-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).