public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/68026] New: Regression in GCC-6.0.0's optimizer
@ 2015-10-20  3:00 ishiura-compiler at ml dot kwansei.ac.jp
  2015-10-20  8:02 ` [Bug tree-optimization/68026] [6 Regression] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ishiura-compiler at ml dot kwansei.ac.jp @ 2015-10-20  3:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 68026
           Summary: Regression in GCC-6.0.0's optimizer
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ishiura-compiler at ml dot kwansei.ac.jp
  Target Milestone: ---

We compiled a program (A.c) by GCC-5.1.0 and GCC-6.0.0 with -O3 option.
GCC-5.1.0 performed better optimization than GCC-6.0.0.

(A.c)
int main (void)
{
        volatile int x1 = 1;
        volatile int x2 = 1;
        int x3 = 2;
        int t = 1;

        t = 3<=(x2|1|x3|x1-1U);

        if (t == 1) {} 
        else { __builtin_abort(); }

    return 0;
}

+--------------------------------------+--------------------------------------+
|  gcc-5.1.0.s (gcc-5.1.0 A.c -O3 -S)  |  gcc-6.0.0.s (gcc-6.0.0 A.c -O3 -S)  |
+--------------------------------------+--------------------------------------+
|main:                                 |main:                                 |
|.LFB0:                                |.LFB0:                                |
|        .cfi_startproc                |        .cfi_startproc                |
|        movl    $1, -8(%rsp)          |        subq    $24, %rsp             |
|        movl    $1, -4(%rsp)          |        .cfi_def_cfa_offset 32        |
|        movl    -4(%rsp), %eax        |        movl    $1, 8(%rsp)           |
|        movl    -8(%rsp), %eax        |        movl    $1, 12(%rsp)          |
|                                      |        movl    12(%rsp), %eax        |
|                                      |        movl    8(%rsp), %edx         |
|                                      |        orl     $3, %eax              |
|                                      |        movl    %eax, %ecx            |
|                                      |        leal    -1(%rdx), %eax        |
|                                      |        orl     %ecx, %eax            |
|                                      |        cmpl    $2, %eax              |
|                                      |        jbe     .L5                   |
|        xorl    %eax, %eax            |        xorl    %eax, %eax            |
|                                      |        addq    $24, %rsp             |
|                                      |        .cfi_remember_state           |
|                                      |        .cfi_def_cfa_offset 8         |
|        ret                           |        ret                           |
|                                      |.L5:                                  |
|                                      |        .cfi_restore_state            |
|                                      |        call    abort                 |
|        .cfi_endproc                  |        .cfi_endproc                  |
|.LFE0:                                |.LFE0:                                |
|        .size   main, .-main          |        .size   main, .-main          |
|        .section        .text.unlikely|        .ident  "GCC: (GNU) 6.0.0  ...|
|.LCOLDE0:                             |                                      |
|        .section        .text.startup |                                      |
|.LHOTE0:                              |                                      |
|        .ident  "GCC: (Ubuntu 5.1.0...|                                      |
|        .section        .note.GNU-s...|        .section        .note.GNU-s...|
+--------------------------------------+--------------------------------------+

Using built-in specs.
COLLECT_GCC=gcc-5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
5.1.0-0ubuntu11~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-5 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=c++98 --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.1.0 (Ubuntu 5.1.0-0ubuntu11~14.04.1) 

Using built-in specs.
COLLECT_GCC=gcc-6.0
COLLECT_LTO_WRAPPER=/home/iwatsuji/opt/gcc-6.0/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/iwatsuji/opt/gcc-6.0
--program-suffix=-6.0 --disable-multilib --enable-languages=c
Thread model: posix
gcc version 6.0.0 20151014 (experimental) (GCC)
>From gcc-bugs-return-499993-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 20 03:08:26 2015
Return-Path: <gcc-bugs-return-499993-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 99556 invoked by alias); 20 Oct 2015 03:08:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 99476 invoked by uid 48); 20 Oct 2015 03:08:13 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/68026] Regression in GCC-6.0.0's optimizer
Date: Tue, 20 Oct 2015 03:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords component
Message-ID: <bug-68026-4-4qvpZ5HhWh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-68026-4@http.gcc.gnu.org/bugzilla/>
References: <bug-68026-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg01548.txt.bz2
Content-length: 735

https://gcc.gnu.org/bugzilla/show_bug.cgi?idh026

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
          Component|c                           |tree-optimization

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

        t = 3<=(x2|1|x3|x1-1U);
Doing the non-volatile sub:
t = 3 <= (x2 | 1 | 2 | (x1 - 1u))
...

t = 3 <= (x2 | 3 | (x1 - 1u))
or:
t = 3 <= 3 | x2 | (x1 - 1u)
Which is:

t = true, x1, x2.

Only if re-association happens with casts thrown in too which might be the
case of the  regression.


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

* [Bug tree-optimization/68026] [6 Regression] Regression in GCC-6.0.0's optimizer
  2015-10-20  3:00 [Bug c/68026] New: Regression in GCC-6.0.0's optimizer ishiura-compiler at ml dot kwansei.ac.jp
@ 2015-10-20  8:02 ` rguenth at gcc dot gnu.org
  2015-10-20  9:06 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-20  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-20
   Target Milestone|---                         |6.0
            Summary|Regression in GCC-6.0.0's   |[6 Regression] Regression
                   |optimizer                   |in GCC-6.0.0's optimizer
     Ever confirmed|0                           |1


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

* [Bug tree-optimization/68026] [6 Regression] Regression in GCC-6.0.0's optimizer
  2015-10-20  3:00 [Bug c/68026] New: Regression in GCC-6.0.0's optimizer ishiura-compiler at ml dot kwansei.ac.jp
  2015-10-20  8:02 ` [Bug tree-optimization/68026] [6 Regression] " rguenth at gcc dot gnu.org
@ 2015-10-20  9:06 ` mpolacek at gcc dot gnu.org
  2015-10-20 10:13 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-20  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r222085.


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

* [Bug tree-optimization/68026] [6 Regression] Regression in GCC-6.0.0's optimizer
  2015-10-20  3:00 [Bug c/68026] New: Regression in GCC-6.0.0's optimizer ishiura-compiler at ml dot kwansei.ac.jp
  2015-10-20  8:02 ` [Bug tree-optimization/68026] [6 Regression] " rguenth at gcc dot gnu.org
  2015-10-20  9:06 ` mpolacek at gcc dot gnu.org
@ 2015-10-20 10:13 ` rguenth at gcc dot gnu.org
  2015-10-21  7:57 ` rguenth at gcc dot gnu.org
  2015-10-21  7:57 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-20 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.


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

* [Bug tree-optimization/68026] [6 Regression] Regression in GCC-6.0.0's optimizer
  2015-10-20  3:00 [Bug c/68026] New: Regression in GCC-6.0.0's optimizer ishiura-compiler at ml dot kwansei.ac.jp
                   ` (2 preceding siblings ...)
  2015-10-20 10:13 ` rguenth at gcc dot gnu.org
@ 2015-10-21  7:57 ` rguenth at gcc dot gnu.org
  2015-10-21  7:57 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-21  7:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

* [Bug tree-optimization/68026] [6 Regression] Regression in GCC-6.0.0's optimizer
  2015-10-20  3:00 [Bug c/68026] New: Regression in GCC-6.0.0's optimizer ishiura-compiler at ml dot kwansei.ac.jp
                   ` (3 preceding siblings ...)
  2015-10-21  7:57 ` rguenth at gcc dot gnu.org
@ 2015-10-21  7:57 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-21  7:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Oct 21 07:56:54 2015
New Revision: 229117

URL: https://gcc.gnu.org/viewcvs?rev=229117&root=gcc&view=rev
Log:
2015-10-21  Richard Biener  <rguenther@suse.de>

        PR tree-optimization/68026
        * tree-ssa-ccp.c (get_value_for_expr): Zero-extend mask for
        unsigned VARYING values.

        * gcc.dg/tree-ssa/ssa-ccp-39.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-39.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-ccp.c


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

end of thread, other threads:[~2015-10-21  7:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-20  3:00 [Bug c/68026] New: Regression in GCC-6.0.0's optimizer ishiura-compiler at ml dot kwansei.ac.jp
2015-10-20  8:02 ` [Bug tree-optimization/68026] [6 Regression] " rguenth at gcc dot gnu.org
2015-10-20  9:06 ` mpolacek at gcc dot gnu.org
2015-10-20 10:13 ` rguenth at gcc dot gnu.org
2015-10-21  7:57 ` rguenth at gcc dot gnu.org
2015-10-21  7:57 ` 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).