public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "matt at use dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/51182] New: [ipa-iterations] running multiple passes of early IPA on a file produces difference code when it shouldn't
Date: Wed, 16 Nov 2011 23:12:00 -0000	[thread overview]
Message-ID: <bug-51182-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 51182
           Summary: [ipa-iterations] running multiple passes of early IPA
                    on a file produces difference code when it shouldn't
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: matt@use.net


Created attachment 25841
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25841
pre-procecessed source that produces the above code differances

As requested by Richard (http://gcc.gnu.org/ml/gcc-cvs/2011-11/msg00669.html),
I am testing the outstanding multiple iterations patch and reporting when
multiple early IPA passes produce differences in code generation that should
probably be gotten in one pass (or not at all).

The attached file is from the open source pmccabe project. When compiling with
-O1, there are register scheduling differences and the elimination of a nop
instruction when doing a second early IPA pass.

with -O1 --param eipa-iterations=1:
 2b3:   8d 6d 01                lea    0x1(%rbp),%ebp
 2b6:   48 98                   cltq   
 2b8:   48 8d 5c c3 f8          lea    -0x8(%rbx,%rax,8),%rbx
 2bd:   83 3d 00 00 00 00 00    cmpl   $0x0,0x0(%rip)        # 2c4 <main+0x180>
 2c4:   74 12                   je     2d8 <main+0x194>
 2c6:   48 89 de                mov    %rbx,%rsi
 2c9:   89 ef                   mov    %ebp,%edi
[...]
 429:   80 78 50 01             cmpb   $0x1,0x50(%rax)
 42d:   0f 1f 00                nopl   (%rax)
 430:   76 2e                   jbe    460 <stats_accumulate+0x4c>


with -O1 --param eipa-iterations=2:
 2b3:   44 8d 65 01             lea    0x1(%rbp),%r12d
 2b7:   48 98                   cltq   
 2b9:   48 8d 5c c3 f8          lea    -0x8(%rbx,%rax,8),%rbx
 2be:   83 3d 00 00 00 00 00    cmpl   $0x0,0x0(%rip)        # 2c5 <main+0x181>
 2c5:   74 13                   je     2da <main+0x196>
 2c7:   48 89 de                mov    %rbx,%rsi
 2ca:   44 89 e7                mov    %r12d,%edi
[...]

 42f:   80 78 50 01             cmpb   $0x1,0x50(%rax)
 433:   76 2e                   jbe    463 <stats_accumulate+0x49>

There are additional/different differences at -O2, but I'll file those in
another bug once I get feedback on this one.


             reply	other threads:[~2011-11-16 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 23:12 matt at use dot net [this message]
2011-11-16 23:13 ` [Bug middle-end/51182] " matt at use dot net
2011-11-17 19:47 ` [Bug middle-end/51182] [ipa-iterations] running multiple passes of early IPA on a file produces different " rguenth at gcc dot gnu.org
2011-11-18  2:19 ` matt at use dot net
2011-11-18  2:20 ` matt at use dot net

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