public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikpelinux at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58685] [4.7/4.8/4.9 Regression] wrong code at -Os on x86_64-linux-gnu in 64-bit mode (affecting gcc trunk, 4.8, and 4.7)
Date: Fri, 11 Oct 2013 10:58:00 -0000	[thread overview]
Message-ID: <bug-58685-4-jrh4D9ZQOF@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58685-4@http.gcc.gnu.org/bugzilla/>

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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernds at gcc dot gnu.org,
                   |                            |mikpelinux at gmail dot com

--- Comment #1 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Started with r179553, -fshrink-wrap introduction and enabling on x86.  Adding
-fno-shrink-wrap avoids the bug.  Author CC:d.

The code generation differences on this test case at this revision show no
control flow changes but some register save/restore changes:

--- pr58685.s-r179552   2013-10-11 12:46:05.717857352 +0200
+++ pr58685.s-r179553   2013-10-11 12:49:52.847494641 +0200
@@ -45,13 +45,11 @@
 fn3:
 .LFB2:
        .cfi_startproc
-       pushq   %r8
-       .cfi_def_cfa_offset 16
        movl    $0, b(%rip)
        jmp     .L7
 .L9:
-       movl    $0, e(%rip)
        cmpl    $0, (%rdi)
+       movl    $0, e(%rip)
        jne     .L8
        movl    $1, e(%rip)
 .L8:
@@ -61,6 +59,8 @@
        movl    b(%rip), %eax
        testl   %eax, %eax
        jns     .L9
+       pushq   %rdi
+       .cfi_def_cfa_offset 16
        xorl    %eax, %eax
        call    fn1
        cmpl    $0, c(%rip)
@@ -81,7 +81,7 @@
 main:
 .LFB3:
        .cfi_startproc
-       pushq   %r10
+       pushq   %r9
        .cfi_def_cfa_offset 16
        movq    g(%rip), %rdi
        call    fn3
@@ -94,7 +94,7 @@
        call    __assert_fail
 .L12:
        xorl    %eax, %eax
-       popq    %r9
+       popq    %r8
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc


  parent reply	other threads:[~2013-10-11 10:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 22:52 [Bug tree-optimization/58685] New: " su at cs dot ucdavis.edu
2013-10-11  7:52 ` [Bug tree-optimization/58685] [4.7/4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2013-10-11 10:58 ` mikpelinux at gmail dot com [this message]
2013-10-16 14:23 ` [Bug target/58685] " bernds at gcc dot gnu.org
2013-10-25 10:10 ` 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-58685-4-jrh4D9ZQOF@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).