public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/51182] New: [ipa-iterations] running multiple passes of early IPA on a file produces difference code when it shouldn't
@ 2011-11-16 23:12 matt at use dot net
  2011-11-16 23:13 ` [Bug middle-end/51182] " matt at use dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: matt at use dot net @ 2011-11-16 23:12 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2011-11-18  1:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-16 23:12 [Bug middle-end/51182] New: [ipa-iterations] running multiple passes of early IPA on a file produces difference code when it shouldn't matt at use dot net
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

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