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: unassig...@gcc.gnu.org ReportedBy: m...@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.