http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46395
Summary: [4.6 regression] FAIL: 22_locale/numpunct/members/pod/2.cc execution test Product: gcc Version: unknown Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: sch...@linux-m68k.org CC: r...@gcc.gnu.org Target: m68k-*-* Created attachment 22345 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22345 Preprocessed testcase The patch for rtl-opt/33721 causes wrong code to be generated during postreload for 22_locale/numpunct/members/pod/2.cc. The relevant difference is this: @@ -4010,15 +4015,14 @@ _Z6test01v: jsr _ZNSt6locale7classicEv .LEHE49: move.l %a0,-(%sp) - move.l %fp,%d4 - subq.l #6,%d4 - move.l %d4,-(%sp) + moveq #-46,%d4 + pea (%fp,%d4.l) .cfi_escape 0x2e,0x8 jsr _ZNSt6localeC1ERKS_ - addq.l #4,%sp - move.l %d4,(%sp) + addq.l #8,%sp + pea (%fp,%d4.l) pea 44(%a2) - lea (-10,%fp),%a5 + lea (-42,%fp),%a5 move.l %a5,%a1 lea _ZNSt9basic_iosIN9__gnu_cxx9characterItj11__mbstate_tEESt11char_traitsIS3_EE5imbueERKSt6locale,%a4 lea _ZNSt6localeD1Ev,%a3 This changes the value of %d4, but there are other uses of %d4 that still assume that it is the address of the variable loc. lea _ZNSt6localeD1Ev,%a3 ... .L628: move.l %d4,-(%sp) .cfi_escape 0x2e,0x4 jsr (%a3) addq.l #4,%sp ... .LEHB55: .cfi_escape 0x2e,0x4 jsr _Znwj clr.l 4(%a0) move.l #_ZTVSt7num_putIN9__gnu_cxx9characterItj11__mbstate_tEESt19ostreambuf_iteratorIS3_St11char_traitsIS3_EEE+8,(%a0) move.l %a0,(%sp) move.l %d4,-(%sp) moveq #-38,%d6 add.l %fp,%d6 move.l %d6,-(%sp) .cfi_escape 0x2e,0xc jsr _ZNSt6localeC1ISt7num_putIN9__gnu_cxx9characterItj11__mbstate_tEESt19ostreambuf_iteratorIS5_St11char_traitsIS5_EEEEERKS_PT_