egcs egcs-980925 3pm PDT miscompiled libg++

H.J. Lu hjl@lucon.org
Sat Sep 26 00:52:00 GMT 1998


Hi,

egcs as of 980925 3pm PDT miscompiled libg++ on Linux/x86. String.cc
is miscompiled. As the result, "make check" failed in libg++. The
miscompiled code looks like

0x400230b7 <Sprepend__FP6StrRepPCci+259>:       movl   %edi,0xfffffff0(%ebp)
0x400230ba <Sprepend__FP6StrRepPCci+262>:       movl   0xfffffff4(%ebp),%edi
0x400230bd <Sprepend__FP6StrRepPCci+265>:       movl   0xfffffff0(%ebp),%ecx
0x400230c0 <Sprepend__FP6StrRepPCci+268>:       movl   0xfffffffc(%ebp),%edx
0x400230c3 <Sprepend__FP6StrRepPCci+271>:       movw   %di,(%ecx)
0x400230c6 <Sprepend__FP6StrRepPCci+274>:       movl   0xfffffff4(%ebp),%ecx
0x400230c9 <Sprepend__FP6StrRepPCci+277>:       addl   0xfffffff8(%ebp),%edx
0x400230cc <Sprepend__FP6StrRepPCci+280>:       movl   %ecx,%edi
0x400230ce <Sprepend__FP6StrRepPCci+282>:       leal   0x4(%edi,%ecx,1),%esi

The correct one should be

0x4002707a <Sprepend__FP6StrRepPCci+258>:       movl   %edi,0xfffffff0(%ebp)
0x4002707d <Sprepend__FP6StrRepPCci+261>:       movl   0xfffffff0(%ebp),%ecx
0x40027080 <Sprepend__FP6StrRepPCci+264>:       movl   0xfffffff4(%ebp),%edi
0x40027083 <Sprepend__FP6StrRepPCci+267>:       movw   %di,(%ecx)
0x40027086 <Sprepend__FP6StrRepPCci+270>:       movl   0xfffffffc(%ebp),%edx
0x40027089 <Sprepend__FP6StrRepPCci+273>:       movl   0xfffffff4(%ebp),%edi
0x4002708c <Sprepend__FP6StrRepPCci+276>:       addl   0xfffffff8(%ebp),%edx
0x4002708f <Sprepend__FP6StrRepPCci+279>:       leal   0x4(%ecx,%edi,1),%esi

The problem is with

0x400230c6 <Sprepend__FP6StrRepPCci+274>:       movl   0xfffffff4(%ebp),%ecx
0x400230c9 <Sprepend__FP6StrRepPCci+277>:       addl   0xfffffff8(%ebp),%edx
0x400230cc <Sprepend__FP6StrRepPCci+280>:       movl   %ecx,%edi

It clobbered ecx.


-- 
H.J. Lu (hjl@gnu.org)



More information about the Gcc mailing list