From: SF/projects/mingw n. l. <min...@li...> - 2012-12-10 12:17:45
|
Bugs item #3594446, was opened at 2012-12-10 04:17 Message generated for change (Tracker Item Submitted) made by oleh_derevenko You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3594446&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Oleh Derevenko (oleh_derevenko) Assigned to: Nobody/Anonymous (nobody) Summary: GCC adds extra stack adjustment after function call with -O3 Initial Comment: After upgrading to GCC 4.7.2 I'having an issue that release build of my DLL crashes. Debugging shows that this is due to extra stack adjustment operation inserted by GCC, Alas I can't provide small test case but here is the faulting function fragment itself. ----------------------- int CProfileGenerator::CalcAccProfile( pos_type p0, vel_type v0, acc_type a0, jerk_type j, vel_type vel, acc_type acc, CProfile& ret_profile ) const { time_type t0 = 0.0; ret_profile.clear(); ret_profile.reserve(10); vel_type dv = vel-v0; if (ABS(dv) < m_epsilon_v && ABS(a0) < m_epsilon_a) { if (dv == 0.0) { ret_profile.push_back(CProfileStep(0.0, p0, v0, a0, 0.0)); VALIDATEPROFILE(ret_profile); } else { acc_type a0 = (dv<0.0)?-1.0:1.0; time_type dt = ABS(dv); pos_type p1 = p0 + v0*dt + 0.5*dv*dv; ret_profile.push_back(CProfileStep(0.0, p0, v0, a0, 0.0)); VALIDATEPROFILE(ret_profile); ret_profile.push_back(CProfileStep(dt, p1, vel, 0.0, 0.0)); VALIDATEPROFILE(ret_profile); } G_BLOG_4("acc profile calc skiped "); return ret_profile.size(); } if (v0 < vel) { acc = ABS(acc); } else if (v0 == vel) { acc = -SIGN(a0)*ABS(acc); } else { acc = -ABS(acc); } if (j == 0.0) { return InternalAccCalc(t0, p0, v0, 0.0, 0.0, true, true, vel, acc, true, ret_profile); } ... ----------------------- Here all the *_type typedefs are doubles and CProfile is std::vector of CProfileStep structure. I've built library with -fno-inline to be able to see function calls more clearly and here is the problem is assembler code. ----------------------- Dump of assembler code for function CProfileGenerator::CalcAccProfile(double, double, double, double, double, double, CP rofileGenerator::CProfile&) const: 0x100622e0 <+0>: push %ebp 0x100622e1 <+1>: mov %ecx,%ebp 0x100622e3 <+3>: push %edi 0x100622e4 <+4>: push %esi 0x100622e5 <+5>: push %ebx 0x100622e6 <+6>: sub $0x14c,%esp ; <------------------------ Initial stack preparation ends here 0x100622ec <+12>: mov 0x160(%esp),%eax 0x100622f3 <+19>: mov 0x190(%esp),%ebx 0x100622fa <+26>: fldl 0x188(%esp) 0x10062301 <+33>: fstpl 0x98(%esp) ... ... ... 0x1006254a <+618>: jbe 0x10062920 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1600> 0x10062550 <+624>: fldl 0x98(%esp) 0x10062557 <+631>: fstpl (%esp) 0x1006255a <+634>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006255f <+639>: fldl 0xb0(%esp) 0x10062566 <+646>: fldz 0x10062568 <+648>: fld %st(0) 0x1006256a <+650>: fxch %st(2) 0x1006256c <+652>: fucomi %st(2),%st 0x1006256e <+654>: fstp %st(2) 0x10062570 <+656>: jnp 0x10062b00 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2080> ... ... ... 0x10062b00 <+2080>: jne 0x10062580 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+672> 0x10062b06 <+2086>: fstp %st(1) 0x10062b08 <+2088>: fxch %st(1) 0x10062b0a <+2090>: fstpl 0x30(%esp) 0x10062b0e <+2094>: mov %ebx,%ecx 0x10062b10 <+2096>: fldl 0x90(%esp) 0x10062b17 <+2103>: mov $0x1,%edx 0x10062b1c <+2108>: mov $0x1,%eax 0x10062b21 <+2113>: fstpl 0x28(%esp) 0x10062b25 <+2117>: fstl 0x20(%esp) 0x10062b29 <+2121>: fstl 0x18(%esp) 0x10062b2d <+2125>: fldl 0x88(%esp) 0x10062b34 <+2132>: fstpl 0x10(%esp) 0x10062b38 <+2136>: fldl 0xc8(%esp) 0x10062b3f <+2143>: fstpl 0x8(%esp) 0x10062b43 <+2147>: fstpl (%esp) 0x10062b46 <+2150>: call 0x10061890 <CProfileGenerator::InternalAccCalc(double, double, double, double, double, bo ol, bool, double, double, bool, CProfileGenerator::CProfile&) const> 0x10062b4b <+2155>: sub $0x38,%esp <----------------------------------------- THIS COMMAND IS EXTRA AND CORRUPTS STACK POINTER WHICH OTHERWISE WOULD BE VALID! 0x10062b4e <+2158>: add $0x14c,%esp 0x10062b54 <+2164>: pop %ebx 0x10062b55 <+2165>: pop %esi 0x10062b56 <+2166>: pop %edi 0x10062b57 <+2167>: pop %ebp 0x10062b58 <+2168>: ret $0x34 ----------------------- The GCC was auto-installed by setup application from SourceForge H:\Projects\FTSI\other\GUI>"c:\Util\MinGW\bin\g++.exe" -v Using built-in specs. COLLECT_GCC=c:\Util\MinGW\bin\g++.exe COLLECT_LTO_WRAPPER=c:/util/mingw/bin/../libexec/gcc/mingw32/4.7.2/lto-wrapper.e xe Target: mingw32 Configured with: ../gcc-4.7.2/configure --enable-languages=c,c++,ada,fortran,obj c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo mp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1- with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.7.2 (GCC) The file was compiled with following options g++ -D"USED_LIBS=" -D_NDEBUG -DNDEBUG -DNODEBUG -DNO_EXCEPTIONS -D__STL_THREADS -D_MT -DUSE_DELPHI_STRINGS -mwindows -mconsole -mthreads -malign-double -Wall - W -Wno-unused-function -Wno-unused-parameter -O3 -march=i686 -g -DLOGING -D_C ONSOLE -fno-exceptions -fno-rtti -Woverloaded-virtual -fno-inline ../../shared/pr ofiles/MoveProfileGenerator.cpp -c -o bin/release/MoveProfileGenerator.obj Below if complete fragment disassembled for your reference, if necessary ------------------------ Dump of assembler code for function CProfileGenerator::CalcAccProfile(double, double, double, double, double, double, CP rofileGenerator::CProfile&) const: 0x100622e0 <+0>: push %ebp 0x100622e1 <+1>: mov %ecx,%ebp 0x100622e3 <+3>: push %edi 0x100622e4 <+4>: push %esi 0x100622e5 <+5>: push %ebx 0x100622e6 <+6>: sub $0x14c,%esp 0x100622ec <+12>: mov 0x160(%esp),%eax 0x100622f3 <+19>: mov 0x190(%esp),%ebx 0x100622fa <+26>: fldl 0x188(%esp) 0x10062301 <+33>: fstpl 0x98(%esp) 0x10062308 <+40>: mov %eax,0xc8(%esp) 0x1006230f <+47>: mov 0x164(%esp),%eax 0x10062316 <+54>: mov %ebx,%ecx 0x10062318 <+56>: mov %eax,0xcc(%esp) 0x1006231f <+63>: mov 0x168(%esp),%eax 0x10062326 <+70>: mov %eax,0xc0(%esp) 0x1006232d <+77>: mov 0x16c(%esp),%eax 0x10062334 <+84>: mov %eax,0xc4(%esp) 0x1006233b <+91>: mov 0x170(%esp),%eax 0x10062342 <+98>: mov %eax,0xb8(%esp) 0x10062349 <+105>: mov 0x174(%esp),%eax 0x10062350 <+112>: mov %eax,0xbc(%esp) 0x10062357 <+119>: mov 0x178(%esp),%eax 0x1006235e <+126>: mov %eax,0xb0(%esp) 0x10062365 <+133>: mov 0x17c(%esp),%eax 0x1006236c <+140>: mov %eax,0xb4(%esp) 0x10062373 <+147>: mov 0x180(%esp),%eax 0x1006237a <+154>: mov %eax,0xa8(%esp) 0x10062381 <+161>: mov 0x184(%esp),%eax 0x10062388 <+168>: mov %eax,0xac(%esp) 0x1006238f <+175>: call 0x100945e0 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::clear()> 0x10062394 <+180>: mov %ebx,%ecx 0x10062396 <+182>: call 0x10060820 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::reserve(unsigned int)> 0x1006239b <+187>: fldl 0xa8(%esp) 0x100623a2 <+194>: fstl 0x90(%esp) 0x100623a9 <+201>: fldl 0xc0(%esp) 0x100623b0 <+208>: fstl 0x88(%esp) 0x100623b7 <+215>: fsubrp %st,%st(1) 0x100623b9 <+217>: fstl 0x80(%esp) 0x100623c0 <+224>: fstpl (%esp) 0x100623c3 <+227>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100623c8 <+232>: fldl 0x1009a050 0x100623ce <+238>: fucomip %st(1),%st 0x100623d0 <+240>: jbe 0x10062530 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+592> 0x100623d6 <+246>: fldl 0xb8(%esp) 0x100623dd <+253>: fstpl (%esp) 0x100623e0 <+256>: fstpl 0x50(%esp) 0x100623e4 <+260>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100623e9 <+265>: fldl 0x1009a048 0x100623ef <+271>: fucomip %st(1),%st 0x100623f1 <+273>: fstp %st(0) 0x100623f3 <+275>: fldl 0x50(%esp) 0x100623f7 <+279>: jbe 0x10062534 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+596> 0x100623fd <+285>: fldz 0x100623ff <+287>: fld %st(0) 0x10062401 <+289>: fldl 0x80(%esp) 0x10062408 <+296>: fucomip %st(1),%st 0x1006240a <+298>: fstp %st(0) 0x1006240c <+300>: jnp 0x10062ab0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2000> 0x10062412 <+306>: fstp %st(0) 0x10062414 <+308>: jmp 0x10062418 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+312> 0x10062416 <+310>: fstp %st(0) 0x10062418 <+312>: fldz 0x1006241a <+314>: fldl 0x80(%esp) 0x10062421 <+321>: fxch %st(1) 0x10062423 <+323>: fucomip %st(1),%st 0x10062425 <+325>: fstp %st(0) 0x10062427 <+327>: fld1 0x10062429 <+329>: ja 0x10062b60 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2176> 0x1006242f <+335>: fstpl 0xd0(%esp) 0x10062436 <+342>: fldl 0x88(%esp) 0x1006243d <+349>: lea 0xd0(%esp),%eax 0x10062444 <+356>: fmul %st(1),%st 0x10062446 <+358>: mov %eax,0x10(%esp) 0x1006244a <+362>: lea 0xc0(%esp),%eax 0x10062451 <+369>: lea 0x118(%esp),%esi 0x10062458 <+376>: lea 0xe8(%esp),%edi 0x1006245f <+383>: mov %esi,%ecx 0x10062461 <+385>: faddl 0xc8(%esp) 0x10062468 <+392>: mov %eax,0xc(%esp) 0x1006246c <+396>: lea 0xc8(%esp),%eax 0x10062473 <+403>: mov %eax,0x8(%esp) 0x10062477 <+407>: mov %edi,0x14(%esp) 0x1006247b <+411>: fldl 0x80(%esp) 0x10062482 <+418>: fmuls 0x1009f980 0x10062488 <+424>: fmull 0x80(%esp) 0x1006248f <+431>: faddp %st,%st(1) 0x10062491 <+433>: fstpl 0xd8(%esp) 0x10062498 <+440>: fldz 0x1006249a <+442>: fstl 0xe8(%esp) 0x100624a1 <+449>: fstl (%esp) 0x100624a4 <+452>: fstps 0x60(%esp) 0x100624a8 <+456>: fstpl 0x50(%esp) 0x100624ac <+460>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x100624b1 <+465>: mov %ebx,%ecx 0x100624b3 <+467>: sub $0x18,%esp 0x100624b6 <+470>: mov %esi,(%esp) 0x100624b9 <+473>: call 0x10094760 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::push_back(CProfileStepCalculator::CProfileStep const&)> 0x100624be <+478>: sub $0x4,%esp 0x100624c1 <+481>: flds 0x60(%esp) 0x100624c5 <+485>: lea 0xe0(%esp),%eax 0x100624cc <+492>: fstl 0xe8(%esp) 0x100624d3 <+499>: mov %eax,0x10(%esp) 0x100624d7 <+503>: lea 0xa8(%esp),%eax 0x100624de <+510>: fstpl 0xe0(%esp) 0x100624e5 <+517>: mov %eax,0xc(%esp) 0x100624e9 <+521>: lea 0xd8(%esp),%eax 0x100624f0 <+528>: fldl 0x50(%esp) 0x100624f4 <+532>: mov %edi,0x14(%esp) 0x100624f8 <+536>: fstpl (%esp) 0x100624fb <+539>: mov %eax,0x8(%esp) 0x100624ff <+543>: mov %esi,%ecx 0x10062501 <+545>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x10062506 <+550>: mov %ebx,%ecx 0x10062508 <+552>: sub $0x18,%esp 0x1006250b <+555>: mov %esi,(%esp) 0x1006250e <+558>: call 0x10094760 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::push_back(CProfileStepCalculator::CProfileStep const&)> 0x10062513 <+563>: sub $0x4,%esp 0x10062516 <+566>: mov 0x4(%ebx),%edx 0x10062519 <+569>: mov (%ebx),%eax 0x1006251b <+571>: call 0x1005f300 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::size() const> 0x10062520 <+576>: add $0x14c,%esp 0x10062526 <+582>: pop %ebx 0x10062527 <+583>: pop %esi 0x10062528 <+584>: pop %edi 0x10062529 <+585>: pop %ebp 0x1006252a <+586>: ret $0x34 0x1006252d <+589>: lea 0x0(%esi),%esi 0x10062530 <+592>: fstp %st(0) 0x10062532 <+594>: jmp 0x10062536 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+598> 0x10062534 <+596>: fstp %st(0) 0x10062536 <+598>: fldl 0x90(%esp) 0x1006253d <+605>: fldl 0x88(%esp) 0x10062544 <+612>: fxch %st(1) 0x10062546 <+614>: fucomip %st(1),%st 0x10062548 <+616>: fstp %st(0) 0x1006254a <+618>: jbe 0x10062920 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1600> 0x10062550 <+624>: fldl 0x98(%esp) 0x10062557 <+631>: fstpl (%esp) 0x1006255a <+634>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006255f <+639>: fldl 0xb0(%esp) 0x10062566 <+646>: fldz 0x10062568 <+648>: fld %st(0) 0x1006256a <+650>: fxch %st(2) 0x1006256c <+652>: fucomi %st(2),%st 0x1006256e <+654>: fstp %st(2) 0x10062570 <+656>: jnp 0x10062b00 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2080> 0x10062576 <+662>: fstp %st(0) 0x10062578 <+664>: jmp 0x10062582 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+674> 0x1006257a <+666>: lea 0x0(%esi),%esi 0x10062580 <+672>: fstp %st(0) 0x10062582 <+674>: fldl 0xb8(%esp) 0x10062589 <+681>: fldz 0x1006258b <+683>: fxch %st(1) 0x1006258d <+685>: fucomi %st(1),%st 0x1006258f <+687>: jnp 0x10062963 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1667> 0x10062595 <+693>: fstp %st(1) 0x10062597 <+695>: jmp 0x100625a2 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+706> 0x10062599 <+697>: lea 0x0(%esi,%eiz,1),%esi 0x100625a0 <+704>: fstp %st(1) 0x100625a2 <+706>: fldz 0x100625a4 <+708>: fxch %st(2) 0x100625a6 <+710>: fstpl (%esp) 0x100625a9 <+713>: fxch %st(2) 0x100625ab <+715>: fstpl 0x50(%esp) 0x100625af <+719>: fxch %st(1) 0x100625b1 <+721>: fstl 0x60(%esp) 0x100625b5 <+725>: fxch %st(1) 0x100625b7 <+727>: fucomip %st(1),%st 0x100625b9 <+729>: fstp %st(0) 0x100625bb <+731>: ja 0x10062c11 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2353> 0x100625c1 <+737>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100625c6 <+742>: fchs 0x100625c8 <+744>: fldl 0x60(%esp) 0x100625cc <+748>: fldl 0x50(%esp) 0x100625d0 <+752>: fxch %st(2) 0x100625d2 <+754>: fstl 0xe8(%esp) 0x100625d9 <+761>: fxch %st(1) 0x100625db <+763>: fchs 0x100625dd <+765>: fdivp %st,%st(1) 0x100625df <+767>: lea 0xe8(%esp),%eax 0x100625e6 <+774>: mov %eax,0x14(%esp) 0x100625ea <+778>: lea 0xb8(%esp),%eax 0x100625f1 <+785>: lea 0xf0(%esp),%esi 0x100625f8 <+792>: lea 0xc8(%esp),%ecx 0x100625ff <+799>: mov %eax,0x10(%esp) 0x10062603 <+803>: lea 0xc0(%esp),%eax 0x1006260a <+810>: mov %eax,0xc(%esp) 0x1006260e <+814>: mov %ecx,0x8(%esp) 0x10062612 <+818>: mov %esi,%ecx 0x10062614 <+820>: fstpl 0x80(%esp) 0x1006261b <+827>: fldz 0x1006261d <+829>: fstpl (%esp) 0x10062620 <+832>: fstpl 0x50(%esp) 0x10062624 <+836>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x10062629 <+841>: sub $0x18,%esp 0x1006262c <+844>: fldz 0x1006262e <+846>: fstpl 0x10(%esp) 0x10062632 <+850>: lea 0x118(%esp),%edi 0x10062639 <+857>: fldl 0x80(%esp) 0x10062640 <+864>: fstpl 0x8(%esp) 0x10062644 <+868>: mov %esi,0x4(%esp) 0x10062648 <+872>: mov %edi,(%esp) 0x1006264b <+875>: call 0x10082020 <CProfileGenerator::CalcProfileStepNextJerk(CProfileStepCalculator::CProfileSt ep const&, double, double)> 0x10062650 <+880>: fldl 0xb8(%esp) 0x10062657 <+887>: fldz 0x10062659 <+889>: fucomi %st(1),%st 0x1006265b <+891>: fldl 0x50(%esp) 0x1006265f <+895>: ja 0x10062c27 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2375> 0x10062665 <+901>: fstp %st(1) 0x10062667 <+903>: fldz 0x10062669 <+905>: fxch %st(2) 0x1006266b <+907>: fucomip %st(2),%st 0x1006266d <+909>: jbe 0x10062680 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+928> 0x1006266f <+911>: fxch %st(1) 0x10062671 <+913>: fucomip %st(1),%st 0x10062673 <+915>: jbe 0x10062682 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+930> 0x10062675 <+917>: jmp 0x10062e00 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2848> 0x1006267a <+922>: lea 0x0(%esi),%esi 0x10062680 <+928>: fstp %st(1) 0x10062682 <+930>: fldl 0xc0(%esp) 0x10062689 <+937>: fstpl 0x88(%esp) 0x10062690 <+944>: fldl 0xa8(%esp) 0x10062697 <+951>: fldl 0x88(%esp) 0x1006269e <+958>: fxch %st(1) 0x100626a0 <+960>: fucomi %st(1),%st 0x100626a2 <+962>: fstp %st(1) 0x100626a4 <+964>: ja 0x10062b87 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2215> 0x100626aa <+970>: fldl 0x1009a050 0x100626b0 <+976>: jmp 0x100626b4 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+980> 0x100626b2 <+978>: fstp %st(1) 0x100626b4 <+980>: fldl 0x88(%esp) 0x100626bb <+987>: fucomip %st(2),%st 0x100626bd <+989>: ja 0x10062cd0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2544> 0x100626c3 <+995>: jmp 0x100626c7 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+999> 0x100626c5 <+997>: fstp %st(0) 0x100626c7 <+999>: fldz 0x100626c9 <+1001>: fstpl 0x80(%esp) 0x100626d0 <+1008>: fxch %st(1) 0x100626d2 <+1010>: fxch %st(2) 0x100626d4 <+1012>: fldl 0x88(%esp) 0x100626db <+1019>: fsubr %st(3),%st 0x100626dd <+1021>: fstpl (%esp) 0x100626e0 <+1024>: fstpl 0x50(%esp) 0x100626e4 <+1028>: fxch %st(1) 0x100626e6 <+1030>: fstpl 0x60(%esp) 0x100626ea <+1034>: fstpl 0x70(%esp) 0x100626ee <+1038>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100626f3 <+1043>: fldl 0x70(%esp) 0x100626f7 <+1047>: fucomip %st(1),%st 0x100626f9 <+1049>: fstp %st(0) 0x100626fb <+1051>: fldl 0x50(%esp) 0x100626ff <+1055>: fldl 0x60(%esp) 0x10062703 <+1059>: jbe 0x10062730 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1104> 0x10062705 <+1061>: fstp %st(0) 0x10062707 <+1063>: fstp %st(0) 0x10062709 <+1065>: fldl 0xb8(%esp) 0x10062710 <+1072>: fstpl (%esp) 0x10062713 <+1075>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062718 <+1080>: fldl 0x1009a048 0x1006271e <+1086>: fucomip %st(1),%st 0x10062720 <+1088>: fstp %st(0) 0x10062722 <+1090>: fldl 0x50(%esp) 0x10062726 <+1094>: fldl 0x60(%esp) 0x1006272a <+1098>: ja 0x10062c41 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2401> 0x10062730 <+1104>: fldl 0x88(%esp) 0x10062737 <+1111>: fxch %st(1) 0x10062739 <+1113>: fucomi %st(1),%st 0x1006273b <+1115>: fstp %st(1) 0x1006273d <+1117>: jbe 0x10062b67 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2183> 0x10062743 <+1123>: fxch %st(1) 0x10062745 <+1125>: fstpl (%esp) 0x10062748 <+1128>: fstpl 0x60(%esp) 0x1006274c <+1132>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062751 <+1137>: fstpl 0x90(%esp) 0x10062758 <+1144>: fldl 0x60(%esp) 0x1006275c <+1148>: fldl 0xb8(%esp) 0x10062763 <+1155>: fldl 0x90(%esp) 0x1006276a <+1162>: fucomip %st(1),%st 0x1006276c <+1164>: fldz 0x1006276e <+1166>: fldl 0x90(%esp) 0x10062775 <+1173>: fxch %st(1) 0x10062777 <+1175>: seta 0x98(%esp) 0x1006277f <+1183>: fucomip %st(1),%st 0x10062781 <+1185>: fstp %st(0) 0x10062783 <+1187>: fldl 0xb0(%esp) 0x1006278a <+1194>: seta %al 0x1006278d <+1197>: fstpl (%esp) 0x10062790 <+1200>: mov %eax,%esi 0x10062792 <+1202>: fstpl 0x50(%esp) 0x10062796 <+1206>: fstpl 0x60(%esp) 0x1006279a <+1210>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006279f <+1215>: mov %esi,%ecx 0x100627a1 <+1217>: movzbl 0x98(%esp),%edi 0x100627a9 <+1225>: movzbl %cl,%ecx 0x100627ac <+1228>: mov %ecx,0xa0(%esp) 0x100627b3 <+1235>: mov 0xa0(%esp),%edx 0x100627ba <+1242>: mov %ebx,%ecx 0x100627bc <+1244>: mov %edi,%eax 0x100627be <+1246>: fstl 0xb0(%esp) 0x100627c5 <+1253>: fldl 0x90(%esp) 0x100627cc <+1260>: fstpl 0x30(%esp) 0x100627d0 <+1264>: fldl 0x60(%esp) 0x100627d4 <+1268>: fstpl 0x28(%esp) 0x100627d8 <+1272>: fstpl 0x20(%esp) 0x100627dc <+1276>: fldl 0x50(%esp) 0x100627e0 <+1280>: fstpl 0x18(%esp) 0x100627e4 <+1284>: fldl 0x88(%esp) 0x100627eb <+1291>: fstpl 0x10(%esp) 0x100627ef <+1295>: fldl 0xc8(%esp) 0x100627f6 <+1302>: fstpl 0x8(%esp) 0x100627fa <+1306>: fldl 0x80(%esp) 0x10062801 <+1313>: fstpl (%esp) 0x10062804 <+1316>: call 0x10061890 <CProfileGenerator::InternalAccCalc(double, double, double, double, double, bo ol, bool, double, double, bool, CProfileGenerator::CProfile&) const> 0x10062809 <+1321>: sub $0x38,%esp 0x1006280c <+1324>: test %eax,%eax 0x1006280e <+1326>: jg 0x10062520 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+576> 0x10062814 <+1332>: mov %esi,%eax 0x10062816 <+1334>: fldl 0xa8(%esp) 0x1006281d <+1341>: cmp $0x1,%al 0x1006281f <+1343>: sbb %edx,%edx 0x10062821 <+1345>: fstpl 0x20(%esp) 0x10062825 <+1349>: or $0x1,%edx 0x10062828 <+1352>: fldl 0xb0(%esp) 0x1006282f <+1359>: lea 0xe8(%esp),%ecx 0x10062836 <+1366>: cmpb $0x1,0x98(%esp) 0x1006283e <+1374>: fstpl 0x10(%esp) 0x10062842 <+1378>: fldl 0xb8(%esp) 0x10062849 <+1385>: lea 0xe0(%esp),%esi 0x10062850 <+1392>: sbb %eax,%eax 0x10062852 <+1394>: fstpl 0x8(%esp) 0x10062856 <+1398>: or $0x1,%eax 0x10062859 <+1401>: fldl 0xc0(%esp) 0x10062860 <+1408>: mov %ecx,0x2c(%esp) 0x10062864 <+1412>: fstpl (%esp) 0x10062867 <+1415>: mov %esi,0x28(%esp) 0x1006286b <+1419>: mov %edx,0x1c(%esp) 0x1006286f <+1423>: mov %eax,0x18(%esp) 0x10062873 <+1427>: call 0x10081410 <CalcLimitAcc(double, double, double, int, int, double, double&, double&)> 0x10062878 <+1432>: test %al,%al 0x1006287a <+1434>: je 0x10062916 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1590> 0x10062880 <+1440>: fldl 0xe0(%esp) 0x10062887 <+1447>: fstl 0x88(%esp) 0x1006288e <+1454>: fstpl (%esp) 0x10062891 <+1457>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062896 <+1462>: fldl 0xe8(%esp) 0x1006289d <+1469>: fstpl (%esp) 0x100628a0 <+1472>: fstpl 0x50(%esp) 0x100628a4 <+1476>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100628a9 <+1481>: fldl 0x50(%esp) 0x100628ad <+1485>: fxch %st(1) 0x100628af <+1487>: fucomip %st(1),%st 0x100628b1 <+1489>: fstp %st(0) 0x100628b3 <+1491>: ja 0x10062e0c <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2860> 0x100628b9 <+1497>: fldl 0x88(%esp) 0x100628c0 <+1504>: fstpl (%esp) 0x100628c3 <+1507>: call 0x1005f310 <SIGN<double>(double const&)> 0x100628c8 <+1512>: fldl 0x90(%esp) 0x100628cf <+1519>: fstpl (%esp) 0x100628d2 <+1522>: mov %eax,0x98(%esp) 0x100628d9 <+1529>: call 0x1005f310 <SIGN<double>(double const&)> 0x100628de <+1534>: cmp %eax,0x98(%esp) 0x100628e5 <+1541>: mov %eax,%esi 0x100628e7 <+1543>: je 0x10062e32 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2898> 0x100628ed <+1549>: fldl 0xe8(%esp) 0x100628f4 <+1556>: fstl (%esp) 0x100628f7 <+1559>: fstpl 0x50(%esp) 0x100628fb <+1563>: call 0x1005f310 <SIGN<double>(double const&)> 0x10062900 <+1568>: cmp %eax,%esi 0x10062902 <+1570>: fldl 0x50(%esp) 0x10062906 <+1574>: je 0x10062cf0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2576> 0x1006290c <+1580>: fstp %st(0) 0x1006290e <+1582>: jmp 0x10062916 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1590> 0x10062910 <+1584>: fstp %st(0) 0x10062912 <+1586>: jmp 0x10062916 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1590> 0x10062914 <+1588>: fstp %st(0) 0x10062916 <+1590>: xor %eax,%eax 0x10062918 <+1592>: jmp 0x10062520 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+576> 0x1006291d <+1597>: lea 0x0(%esi),%esi 0x10062920 <+1600>: jp 0x10062a95 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1973> 0x10062926 <+1606>: jne 0x10062a95 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1973> 0x1006292c <+1612>: fldl 0xb8(%esp) 0x10062933 <+1619>: fstpl (%esp) 0x10062936 <+1622>: call 0x1005f310 <SIGN<double>(double const&)> 0x1006293b <+1627>: fldl 0x98(%esp) 0x10062942 <+1634>: mov %eax,%esi 0x10062944 <+1636>: fstpl (%esp) 0x10062947 <+1639>: neg %esi 0x10062949 <+1641>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006294e <+1646>: mov %esi,0xa4(%esp) 0x10062955 <+1653>: fildl 0xa4(%esp) 0x1006295c <+1660>: fmulp %st,%st(1) 0x1006295e <+1662>: jmp 0x1006255f <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+639> 0x10062963 <+1667>: jne 0x100625a0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+704> 0x10062969 <+1673>: fstp %st(0) 0x1006296b <+1675>: fxch %st(2) 0x1006296d <+1677>: fstl (%esp) 0x10062970 <+1680>: fxch %st(1) 0x10062972 <+1682>: fstpl 0x60(%esp) 0x10062976 <+1686>: fstpl 0x50(%esp) 0x1006297a <+1690>: fstpl 0x70(%esp) 0x1006297e <+1694>: call 0x1005f310 <SIGN<double>(double const&)> 0x10062983 <+1699>: fldl 0x60(%esp) 0x10062987 <+1703>: mov %eax,%esi 0x10062989 <+1705>: fstpl (%esp) 0x1006298c <+1708>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062991 <+1713>: mov %esi,0xa4(%esp) 0x10062998 <+1720>: fildl 0xa4(%esp) 0x1006299f <+1727>: fmulp %st,%st(1) 0x100629a1 <+1729>: fstl 0xb0(%esp) 0x100629a8 <+1736>: fldl 0x50(%esp) 0x100629ac <+1740>: fld %st(0) 0x100629ae <+1742>: fdiv %st(2),%st 0x100629b0 <+1744>: fxch %st(1) 0x100629b2 <+1746>: fdivrl 0x80(%esp) 0x100629b9 <+1753>: fsub %st(1),%st 0x100629bb <+1755>: fldl 0x70(%esp) 0x100629bf <+1759>: fucomip %st(1),%st 0x100629c1 <+1761>: ja 0x10062db0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2768> 0x100629c7 <+1767>: fstp %st(2) 0x100629c9 <+1769>: fxch %st(1) 0x100629cb <+1771>: fstpl 0x50(%esp) 0x100629cf <+1775>: mov %ebx,%ecx 0x100629d1 <+1777>: fstpl 0x70(%esp) 0x100629d5 <+1781>: call 0x100945e0 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::clear()> 0x100629da <+1786>: mov %ebx,%ecx 0x100629dc <+1788>: call 0x10060820 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::reserve(unsigned int)> 0x100629e1 <+1793>: lea 0xb0(%esp),%eax 0x100629e8 <+1800>: mov %eax,0x14(%esp) 0x100629ec <+1804>: lea 0xb8(%esp),%eax 0x100629f3 <+1811>: mov %eax,0x10(%esp) 0x100629f7 <+1815>: lea 0xc0(%esp),%eax 0x100629fe <+1822>: lea 0x118(%esp),%esi 0x10062a05 <+1829>: mov %eax,0xc(%esp) 0x10062a09 <+1833>: lea 0xc8(%esp),%eax 0x10062a10 <+1840>: mov %esi,%ecx 0x10062a12 <+1842>: mov %eax,0x8(%esp) 0x10062a16 <+1846>: fldz 0x10062a18 <+1848>: fstpl (%esp) 0x10062a1b <+1851>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x10062a20 <+1856>: mov %ebx,%ecx 0x10062a22 <+1858>: sub $0x18,%esp 0x10062a25 <+1861>: mov %esi,(%esp) 0x10062a28 <+1864>: call 0x10094760 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::push_back(CProfileStepCalculator::CProfileStep const&)> 0x10062a2d <+1869>: mov %ebx,%eax 0x10062a2f <+1871>: sub $0x4,%esp 0x10062a32 <+1874>: fldl 0x70(%esp) 0x10062a36 <+1878>: fstpl (%esp) 0x10062a39 <+1881>: call 0x10061470 <CProfileGenerator::ProfilePush(CProfileGenerator::CProfile&, double, double) const> 0x10062a3e <+1886>: mov %ebx,%eax 0x10062a40 <+1888>: fldl 0xb0(%esp) 0x10062a47 <+1895>: fchs 0x10062a49 <+1897>: fstpl 0x8(%esp) 0x10062a4d <+1901>: fldl 0x50(%esp) 0x10062a51 <+1905>: fstpl (%esp) 0x10062a54 <+1908>: call 0x10061420 <CProfileGenerator::ProfilePush(CProfileGenerator::CProfile&, double, double) const> 0x10062a59 <+1913>: mov %ebx,%eax 0x10062a5b <+1915>: fldl 0x70(%esp) 0x10062a5f <+1919>: fstpl (%esp) 0x10062a62 <+1922>: call 0x10061470 <CProfileGenerator::ProfilePush(CProfileGenerator::CProfile&, double, double) const> 0x10062a67 <+1927>: mov %ebx,%ecx 0x10062a69 <+1929>: call 0x10094580 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::back()> 0x10062a6e <+1934>: mov %ebx,%ecx 0x10062a70 <+1936>: fldl 0xa8(%esp) 0x10062a77 <+1943>: fstpl 0x10(%eax) 0x10062a7a <+1946>: call 0x10094580 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::back()> 0x10062a7f <+1951>: mov %ebx,%ecx 0x10062a81 <+1953>: fldz 0x10062a83 <+1955>: fstpl 0x18(%eax) 0x10062a86 <+1958>: call 0x10094580 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::back()> 0x10062a8b <+1963>: fldz 0x10062a8d <+1965>: fstpl 0x20(%eax) 0x10062a90 <+1968>: jmp 0x10062516 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+566> 0x10062a95 <+1973>: fldl 0x98(%esp) 0x10062a9c <+1980>: fstpl (%esp) 0x10062a9f <+1983>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062aa4 <+1988>: fchs 0x10062aa6 <+1990>: jmp 0x1006255f <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+639> 0x10062aab <+1995>: nop 0x10062aac <+1996>: lea 0x0(%esi,%eiz,1),%esi 0x10062ab0 <+2000>: jne 0x10062416 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+310> 0x10062ab6 <+2006>: fstp %st(1) 0x10062ab8 <+2008>: lea 0xe8(%esp),%eax 0x10062abf <+2015>: fstl 0xe8(%esp) 0x10062ac6 <+2022>: mov %eax,0x14(%esp) 0x10062aca <+2026>: lea 0xb8(%esp),%eax 0x10062ad1 <+2033>: mov %eax,0x10(%esp) 0x10062ad5 <+2037>: lea 0xc0(%esp),%eax 0x10062adc <+2044>: mov %eax,0xc(%esp) 0x10062ae0 <+2048>: lea 0xc8(%esp),%eax 0x10062ae7 <+2055>: lea 0x118(%esp),%esi 0x10062aee <+2062>: mov %eax,0x8(%esp) 0x10062af2 <+2066>: fstpl (%esp) 0x10062af5 <+2069>: jmp 0x100624ff <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+543> 0x10062afa <+2074>: lea 0x0(%esi),%esi 0x10062b00 <+2080>: jne 0x10062580 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+672> 0x10062b06 <+2086>: fstp %st(1) 0x10062b08 <+2088>: fxch %st(1) 0x10062b0a <+2090>: fstpl 0x30(%esp) 0x10062b0e <+2094>: mov %ebx,%ecx 0x10062b10 <+2096>: fldl 0x90(%esp) 0x10062b17 <+2103>: mov $0x1,%edx 0x10062b1c <+2108>: mov $0x1,%eax 0x10062b21 <+2113>: fstpl 0x28(%esp) 0x10062b25 <+2117>: fstl 0x20(%esp) 0x10062b29 <+2121>: fstl 0x18(%esp) 0x10062b2d <+2125>: fldl 0x88(%esp) 0x10062b34 <+2132>: fstpl 0x10(%esp) 0x10062b38 <+2136>: fldl 0xc8(%esp) 0x10062b3f <+2143>: fstpl 0x8(%esp) 0x10062b43 <+2147>: fstpl (%esp) 0x10062b46 <+2150>: call 0x10061890 <CProfileGenerator::InternalAccCalc(double, double, double, double, double, bo ol, bool, double, double, bool, CProfileGenerator::CProfile&) const> 0x10062b4b <+2155>: sub $0x38,%esp 0x10062b4e <+2158>: add $0x14c,%esp 0x10062b54 <+2164>: pop %ebx 0x10062b55 <+2165>: pop %esi 0x10062b56 <+2166>: pop %edi 0x10062b57 <+2167>: pop %ebp 0x10062b58 <+2168>: ret $0x34 ------------------------ ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3594446&group_id=2435 |
From: SF/projects/mingw n. l. <min...@li...> - 2012-12-10 13:54:55
|
Bugs item #3594446, was opened at 2012-12-10 04:17 Message generated for change (Comment added) made by oleh_derevenko You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3594446&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Oleh Derevenko (oleh_derevenko) Assigned to: Nobody/Anonymous (nobody) Summary: GCC adds extra stack adjustment after function call with -O3 Initial Comment: After upgrading to GCC 4.7.2 I'having an issue that release build of my DLL crashes. Debugging shows that this is due to extra stack adjustment operation inserted by GCC, Alas I can't provide small test case but here is the faulting function fragment itself. ----------------------- int CProfileGenerator::CalcAccProfile( pos_type p0, vel_type v0, acc_type a0, jerk_type j, vel_type vel, acc_type acc, CProfile& ret_profile ) const { time_type t0 = 0.0; ret_profile.clear(); ret_profile.reserve(10); vel_type dv = vel-v0; if (ABS(dv) < m_epsilon_v && ABS(a0) < m_epsilon_a) { if (dv == 0.0) { ret_profile.push_back(CProfileStep(0.0, p0, v0, a0, 0.0)); VALIDATEPROFILE(ret_profile); } else { acc_type a0 = (dv<0.0)?-1.0:1.0; time_type dt = ABS(dv); pos_type p1 = p0 + v0*dt + 0.5*dv*dv; ret_profile.push_back(CProfileStep(0.0, p0, v0, a0, 0.0)); VALIDATEPROFILE(ret_profile); ret_profile.push_back(CProfileStep(dt, p1, vel, 0.0, 0.0)); VALIDATEPROFILE(ret_profile); } G_BLOG_4("acc profile calc skiped "); return ret_profile.size(); } if (v0 < vel) { acc = ABS(acc); } else if (v0 == vel) { acc = -SIGN(a0)*ABS(acc); } else { acc = -ABS(acc); } if (j == 0.0) { return InternalAccCalc(t0, p0, v0, 0.0, 0.0, true, true, vel, acc, true, ret_profile); } ... ----------------------- Here all the *_type typedefs are doubles and CProfile is std::vector of CProfileStep structure. I've built library with -fno-inline to be able to see function calls more clearly and here is the problem is assembler code. ----------------------- Dump of assembler code for function CProfileGenerator::CalcAccProfile(double, double, double, double, double, double, CP rofileGenerator::CProfile&) const: 0x100622e0 <+0>: push %ebp 0x100622e1 <+1>: mov %ecx,%ebp 0x100622e3 <+3>: push %edi 0x100622e4 <+4>: push %esi 0x100622e5 <+5>: push %ebx 0x100622e6 <+6>: sub $0x14c,%esp ; <------------------------ Initial stack preparation ends here 0x100622ec <+12>: mov 0x160(%esp),%eax 0x100622f3 <+19>: mov 0x190(%esp),%ebx 0x100622fa <+26>: fldl 0x188(%esp) 0x10062301 <+33>: fstpl 0x98(%esp) ... ... ... 0x1006254a <+618>: jbe 0x10062920 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1600> 0x10062550 <+624>: fldl 0x98(%esp) 0x10062557 <+631>: fstpl (%esp) 0x1006255a <+634>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006255f <+639>: fldl 0xb0(%esp) 0x10062566 <+646>: fldz 0x10062568 <+648>: fld %st(0) 0x1006256a <+650>: fxch %st(2) 0x1006256c <+652>: fucomi %st(2),%st 0x1006256e <+654>: fstp %st(2) 0x10062570 <+656>: jnp 0x10062b00 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2080> ... ... ... 0x10062b00 <+2080>: jne 0x10062580 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+672> 0x10062b06 <+2086>: fstp %st(1) 0x10062b08 <+2088>: fxch %st(1) 0x10062b0a <+2090>: fstpl 0x30(%esp) 0x10062b0e <+2094>: mov %ebx,%ecx 0x10062b10 <+2096>: fldl 0x90(%esp) 0x10062b17 <+2103>: mov $0x1,%edx 0x10062b1c <+2108>: mov $0x1,%eax 0x10062b21 <+2113>: fstpl 0x28(%esp) 0x10062b25 <+2117>: fstl 0x20(%esp) 0x10062b29 <+2121>: fstl 0x18(%esp) 0x10062b2d <+2125>: fldl 0x88(%esp) 0x10062b34 <+2132>: fstpl 0x10(%esp) 0x10062b38 <+2136>: fldl 0xc8(%esp) 0x10062b3f <+2143>: fstpl 0x8(%esp) 0x10062b43 <+2147>: fstpl (%esp) 0x10062b46 <+2150>: call 0x10061890 <CProfileGenerator::InternalAccCalc(double, double, double, double, double, bo ol, bool, double, double, bool, CProfileGenerator::CProfile&) const> 0x10062b4b <+2155>: sub $0x38,%esp <----------------------------------------- THIS COMMAND IS EXTRA AND CORRUPTS STACK POINTER WHICH OTHERWISE WOULD BE VALID! 0x10062b4e <+2158>: add $0x14c,%esp 0x10062b54 <+2164>: pop %ebx 0x10062b55 <+2165>: pop %esi 0x10062b56 <+2166>: pop %edi 0x10062b57 <+2167>: pop %ebp 0x10062b58 <+2168>: ret $0x34 ----------------------- The GCC was auto-installed by setup application from SourceForge H:\Projects\FTSI\other\GUI>"c:\Util\MinGW\bin\g++.exe" -v Using built-in specs. COLLECT_GCC=c:\Util\MinGW\bin\g++.exe COLLECT_LTO_WRAPPER=c:/util/mingw/bin/../libexec/gcc/mingw32/4.7.2/lto-wrapper.e xe Target: mingw32 Configured with: ../gcc-4.7.2/configure --enable-languages=c,c++,ada,fortran,obj c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo mp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1- with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.7.2 (GCC) The file was compiled with following options g++ -D"USED_LIBS=" -D_NDEBUG -DNDEBUG -DNODEBUG -DNO_EXCEPTIONS -D__STL_THREADS -D_MT -DUSE_DELPHI_STRINGS -mwindows -mconsole -mthreads -malign-double -Wall - W -Wno-unused-function -Wno-unused-parameter -O3 -march=i686 -g -DLOGING -D_C ONSOLE -fno-exceptions -fno-rtti -Woverloaded-virtual -fno-inline ../../shared/pr ofiles/MoveProfileGenerator.cpp -c -o bin/release/MoveProfileGenerator.obj Below if complete fragment disassembled for your reference, if necessary ------------------------ Dump of assembler code for function CProfileGenerator::CalcAccProfile(double, double, double, double, double, double, CP rofileGenerator::CProfile&) const: 0x100622e0 <+0>: push %ebp 0x100622e1 <+1>: mov %ecx,%ebp 0x100622e3 <+3>: push %edi 0x100622e4 <+4>: push %esi 0x100622e5 <+5>: push %ebx 0x100622e6 <+6>: sub $0x14c,%esp 0x100622ec <+12>: mov 0x160(%esp),%eax 0x100622f3 <+19>: mov 0x190(%esp),%ebx 0x100622fa <+26>: fldl 0x188(%esp) 0x10062301 <+33>: fstpl 0x98(%esp) 0x10062308 <+40>: mov %eax,0xc8(%esp) 0x1006230f <+47>: mov 0x164(%esp),%eax 0x10062316 <+54>: mov %ebx,%ecx 0x10062318 <+56>: mov %eax,0xcc(%esp) 0x1006231f <+63>: mov 0x168(%esp),%eax 0x10062326 <+70>: mov %eax,0xc0(%esp) 0x1006232d <+77>: mov 0x16c(%esp),%eax 0x10062334 <+84>: mov %eax,0xc4(%esp) 0x1006233b <+91>: mov 0x170(%esp),%eax 0x10062342 <+98>: mov %eax,0xb8(%esp) 0x10062349 <+105>: mov 0x174(%esp),%eax 0x10062350 <+112>: mov %eax,0xbc(%esp) 0x10062357 <+119>: mov 0x178(%esp),%eax 0x1006235e <+126>: mov %eax,0xb0(%esp) 0x10062365 <+133>: mov 0x17c(%esp),%eax 0x1006236c <+140>: mov %eax,0xb4(%esp) 0x10062373 <+147>: mov 0x180(%esp),%eax 0x1006237a <+154>: mov %eax,0xa8(%esp) 0x10062381 <+161>: mov 0x184(%esp),%eax 0x10062388 <+168>: mov %eax,0xac(%esp) 0x1006238f <+175>: call 0x100945e0 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::clear()> 0x10062394 <+180>: mov %ebx,%ecx 0x10062396 <+182>: call 0x10060820 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::reserve(unsigned int)> 0x1006239b <+187>: fldl 0xa8(%esp) 0x100623a2 <+194>: fstl 0x90(%esp) 0x100623a9 <+201>: fldl 0xc0(%esp) 0x100623b0 <+208>: fstl 0x88(%esp) 0x100623b7 <+215>: fsubrp %st,%st(1) 0x100623b9 <+217>: fstl 0x80(%esp) 0x100623c0 <+224>: fstpl (%esp) 0x100623c3 <+227>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100623c8 <+232>: fldl 0x1009a050 0x100623ce <+238>: fucomip %st(1),%st 0x100623d0 <+240>: jbe 0x10062530 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+592> 0x100623d6 <+246>: fldl 0xb8(%esp) 0x100623dd <+253>: fstpl (%esp) 0x100623e0 <+256>: fstpl 0x50(%esp) 0x100623e4 <+260>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100623e9 <+265>: fldl 0x1009a048 0x100623ef <+271>: fucomip %st(1),%st 0x100623f1 <+273>: fstp %st(0) 0x100623f3 <+275>: fldl 0x50(%esp) 0x100623f7 <+279>: jbe 0x10062534 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+596> 0x100623fd <+285>: fldz 0x100623ff <+287>: fld %st(0) 0x10062401 <+289>: fldl 0x80(%esp) 0x10062408 <+296>: fucomip %st(1),%st 0x1006240a <+298>: fstp %st(0) 0x1006240c <+300>: jnp 0x10062ab0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2000> 0x10062412 <+306>: fstp %st(0) 0x10062414 <+308>: jmp 0x10062418 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+312> 0x10062416 <+310>: fstp %st(0) 0x10062418 <+312>: fldz 0x1006241a <+314>: fldl 0x80(%esp) 0x10062421 <+321>: fxch %st(1) 0x10062423 <+323>: fucomip %st(1),%st 0x10062425 <+325>: fstp %st(0) 0x10062427 <+327>: fld1 0x10062429 <+329>: ja 0x10062b60 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2176> 0x1006242f <+335>: fstpl 0xd0(%esp) 0x10062436 <+342>: fldl 0x88(%esp) 0x1006243d <+349>: lea 0xd0(%esp),%eax 0x10062444 <+356>: fmul %st(1),%st 0x10062446 <+358>: mov %eax,0x10(%esp) 0x1006244a <+362>: lea 0xc0(%esp),%eax 0x10062451 <+369>: lea 0x118(%esp),%esi 0x10062458 <+376>: lea 0xe8(%esp),%edi 0x1006245f <+383>: mov %esi,%ecx 0x10062461 <+385>: faddl 0xc8(%esp) 0x10062468 <+392>: mov %eax,0xc(%esp) 0x1006246c <+396>: lea 0xc8(%esp),%eax 0x10062473 <+403>: mov %eax,0x8(%esp) 0x10062477 <+407>: mov %edi,0x14(%esp) 0x1006247b <+411>: fldl 0x80(%esp) 0x10062482 <+418>: fmuls 0x1009f980 0x10062488 <+424>: fmull 0x80(%esp) 0x1006248f <+431>: faddp %st,%st(1) 0x10062491 <+433>: fstpl 0xd8(%esp) 0x10062498 <+440>: fldz 0x1006249a <+442>: fstl 0xe8(%esp) 0x100624a1 <+449>: fstl (%esp) 0x100624a4 <+452>: fstps 0x60(%esp) 0x100624a8 <+456>: fstpl 0x50(%esp) 0x100624ac <+460>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x100624b1 <+465>: mov %ebx,%ecx 0x100624b3 <+467>: sub $0x18,%esp 0x100624b6 <+470>: mov %esi,(%esp) 0x100624b9 <+473>: call 0x10094760 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::push_back(CProfileStepCalculator::CProfileStep const&)> 0x100624be <+478>: sub $0x4,%esp 0x100624c1 <+481>: flds 0x60(%esp) 0x100624c5 <+485>: lea 0xe0(%esp),%eax 0x100624cc <+492>: fstl 0xe8(%esp) 0x100624d3 <+499>: mov %eax,0x10(%esp) 0x100624d7 <+503>: lea 0xa8(%esp),%eax 0x100624de <+510>: fstpl 0xe0(%esp) 0x100624e5 <+517>: mov %eax,0xc(%esp) 0x100624e9 <+521>: lea 0xd8(%esp),%eax 0x100624f0 <+528>: fldl 0x50(%esp) 0x100624f4 <+532>: mov %edi,0x14(%esp) 0x100624f8 <+536>: fstpl (%esp) 0x100624fb <+539>: mov %eax,0x8(%esp) 0x100624ff <+543>: mov %esi,%ecx 0x10062501 <+545>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x10062506 <+550>: mov %ebx,%ecx 0x10062508 <+552>: sub $0x18,%esp 0x1006250b <+555>: mov %esi,(%esp) 0x1006250e <+558>: call 0x10094760 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::push_back(CProfileStepCalculator::CProfileStep const&)> 0x10062513 <+563>: sub $0x4,%esp 0x10062516 <+566>: mov 0x4(%ebx),%edx 0x10062519 <+569>: mov (%ebx),%eax 0x1006251b <+571>: call 0x1005f300 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::size() const> 0x10062520 <+576>: add $0x14c,%esp 0x10062526 <+582>: pop %ebx 0x10062527 <+583>: pop %esi 0x10062528 <+584>: pop %edi 0x10062529 <+585>: pop %ebp 0x1006252a <+586>: ret $0x34 0x1006252d <+589>: lea 0x0(%esi),%esi 0x10062530 <+592>: fstp %st(0) 0x10062532 <+594>: jmp 0x10062536 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+598> 0x10062534 <+596>: fstp %st(0) 0x10062536 <+598>: fldl 0x90(%esp) 0x1006253d <+605>: fldl 0x88(%esp) 0x10062544 <+612>: fxch %st(1) 0x10062546 <+614>: fucomip %st(1),%st 0x10062548 <+616>: fstp %st(0) 0x1006254a <+618>: jbe 0x10062920 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1600> 0x10062550 <+624>: fldl 0x98(%esp) 0x10062557 <+631>: fstpl (%esp) 0x1006255a <+634>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006255f <+639>: fldl 0xb0(%esp) 0x10062566 <+646>: fldz 0x10062568 <+648>: fld %st(0) 0x1006256a <+650>: fxch %st(2) 0x1006256c <+652>: fucomi %st(2),%st 0x1006256e <+654>: fstp %st(2) 0x10062570 <+656>: jnp 0x10062b00 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2080> 0x10062576 <+662>: fstp %st(0) 0x10062578 <+664>: jmp 0x10062582 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+674> 0x1006257a <+666>: lea 0x0(%esi),%esi 0x10062580 <+672>: fstp %st(0) 0x10062582 <+674>: fldl 0xb8(%esp) 0x10062589 <+681>: fldz 0x1006258b <+683>: fxch %st(1) 0x1006258d <+685>: fucomi %st(1),%st 0x1006258f <+687>: jnp 0x10062963 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1667> 0x10062595 <+693>: fstp %st(1) 0x10062597 <+695>: jmp 0x100625a2 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+706> 0x10062599 <+697>: lea 0x0(%esi,%eiz,1),%esi 0x100625a0 <+704>: fstp %st(1) 0x100625a2 <+706>: fldz 0x100625a4 <+708>: fxch %st(2) 0x100625a6 <+710>: fstpl (%esp) 0x100625a9 <+713>: fxch %st(2) 0x100625ab <+715>: fstpl 0x50(%esp) 0x100625af <+719>: fxch %st(1) 0x100625b1 <+721>: fstl 0x60(%esp) 0x100625b5 <+725>: fxch %st(1) 0x100625b7 <+727>: fucomip %st(1),%st 0x100625b9 <+729>: fstp %st(0) 0x100625bb <+731>: ja 0x10062c11 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2353> 0x100625c1 <+737>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100625c6 <+742>: fchs 0x100625c8 <+744>: fldl 0x60(%esp) 0x100625cc <+748>: fldl 0x50(%esp) 0x100625d0 <+752>: fxch %st(2) 0x100625d2 <+754>: fstl 0xe8(%esp) 0x100625d9 <+761>: fxch %st(1) 0x100625db <+763>: fchs 0x100625dd <+765>: fdivp %st,%st(1) 0x100625df <+767>: lea 0xe8(%esp),%eax 0x100625e6 <+774>: mov %eax,0x14(%esp) 0x100625ea <+778>: lea 0xb8(%esp),%eax 0x100625f1 <+785>: lea 0xf0(%esp),%esi 0x100625f8 <+792>: lea 0xc8(%esp),%ecx 0x100625ff <+799>: mov %eax,0x10(%esp) 0x10062603 <+803>: lea 0xc0(%esp),%eax 0x1006260a <+810>: mov %eax,0xc(%esp) 0x1006260e <+814>: mov %ecx,0x8(%esp) 0x10062612 <+818>: mov %esi,%ecx 0x10062614 <+820>: fstpl 0x80(%esp) 0x1006261b <+827>: fldz 0x1006261d <+829>: fstpl (%esp) 0x10062620 <+832>: fstpl 0x50(%esp) 0x10062624 <+836>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x10062629 <+841>: sub $0x18,%esp 0x1006262c <+844>: fldz 0x1006262e <+846>: fstpl 0x10(%esp) 0x10062632 <+850>: lea 0x118(%esp),%edi 0x10062639 <+857>: fldl 0x80(%esp) 0x10062640 <+864>: fstpl 0x8(%esp) 0x10062644 <+868>: mov %esi,0x4(%esp) 0x10062648 <+872>: mov %edi,(%esp) 0x1006264b <+875>: call 0x10082020 <CProfileGenerator::CalcProfileStepNextJerk(CProfileStepCalculator::CProfileSt ep const&, double, double)> 0x10062650 <+880>: fldl 0xb8(%esp) 0x10062657 <+887>: fldz 0x10062659 <+889>: fucomi %st(1),%st 0x1006265b <+891>: fldl 0x50(%esp) 0x1006265f <+895>: ja 0x10062c27 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2375> 0x10062665 <+901>: fstp %st(1) 0x10062667 <+903>: fldz 0x10062669 <+905>: fxch %st(2) 0x1006266b <+907>: fucomip %st(2),%st 0x1006266d <+909>: jbe 0x10062680 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+928> 0x1006266f <+911>: fxch %st(1) 0x10062671 <+913>: fucomip %st(1),%st 0x10062673 <+915>: jbe 0x10062682 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+930> 0x10062675 <+917>: jmp 0x10062e00 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2848> 0x1006267a <+922>: lea 0x0(%esi),%esi 0x10062680 <+928>: fstp %st(1) 0x10062682 <+930>: fldl 0xc0(%esp) 0x10062689 <+937>: fstpl 0x88(%esp) 0x10062690 <+944>: fldl 0xa8(%esp) 0x10062697 <+951>: fldl 0x88(%esp) 0x1006269e <+958>: fxch %st(1) 0x100626a0 <+960>: fucomi %st(1),%st 0x100626a2 <+962>: fstp %st(1) 0x100626a4 <+964>: ja 0x10062b87 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2215> 0x100626aa <+970>: fldl 0x1009a050 0x100626b0 <+976>: jmp 0x100626b4 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+980> 0x100626b2 <+978>: fstp %st(1) 0x100626b4 <+980>: fldl 0x88(%esp) 0x100626bb <+987>: fucomip %st(2),%st 0x100626bd <+989>: ja 0x10062cd0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2544> 0x100626c3 <+995>: jmp 0x100626c7 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+999> 0x100626c5 <+997>: fstp %st(0) 0x100626c7 <+999>: fldz 0x100626c9 <+1001>: fstpl 0x80(%esp) 0x100626d0 <+1008>: fxch %st(1) 0x100626d2 <+1010>: fxch %st(2) 0x100626d4 <+1012>: fldl 0x88(%esp) 0x100626db <+1019>: fsubr %st(3),%st 0x100626dd <+1021>: fstpl (%esp) 0x100626e0 <+1024>: fstpl 0x50(%esp) 0x100626e4 <+1028>: fxch %st(1) 0x100626e6 <+1030>: fstpl 0x60(%esp) 0x100626ea <+1034>: fstpl 0x70(%esp) 0x100626ee <+1038>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100626f3 <+1043>: fldl 0x70(%esp) 0x100626f7 <+1047>: fucomip %st(1),%st 0x100626f9 <+1049>: fstp %st(0) 0x100626fb <+1051>: fldl 0x50(%esp) 0x100626ff <+1055>: fldl 0x60(%esp) 0x10062703 <+1059>: jbe 0x10062730 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1104> 0x10062705 <+1061>: fstp %st(0) 0x10062707 <+1063>: fstp %st(0) 0x10062709 <+1065>: fldl 0xb8(%esp) 0x10062710 <+1072>: fstpl (%esp) 0x10062713 <+1075>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062718 <+1080>: fldl 0x1009a048 0x1006271e <+1086>: fucomip %st(1),%st 0x10062720 <+1088>: fstp %st(0) 0x10062722 <+1090>: fldl 0x50(%esp) 0x10062726 <+1094>: fldl 0x60(%esp) 0x1006272a <+1098>: ja 0x10062c41 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2401> 0x10062730 <+1104>: fldl 0x88(%esp) 0x10062737 <+1111>: fxch %st(1) 0x10062739 <+1113>: fucomi %st(1),%st 0x1006273b <+1115>: fstp %st(1) 0x1006273d <+1117>: jbe 0x10062b67 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2183> 0x10062743 <+1123>: fxch %st(1) 0x10062745 <+1125>: fstpl (%esp) 0x10062748 <+1128>: fstpl 0x60(%esp) 0x1006274c <+1132>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062751 <+1137>: fstpl 0x90(%esp) 0x10062758 <+1144>: fldl 0x60(%esp) 0x1006275c <+1148>: fldl 0xb8(%esp) 0x10062763 <+1155>: fldl 0x90(%esp) 0x1006276a <+1162>: fucomip %st(1),%st 0x1006276c <+1164>: fldz 0x1006276e <+1166>: fldl 0x90(%esp) 0x10062775 <+1173>: fxch %st(1) 0x10062777 <+1175>: seta 0x98(%esp) 0x1006277f <+1183>: fucomip %st(1),%st 0x10062781 <+1185>: fstp %st(0) 0x10062783 <+1187>: fldl 0xb0(%esp) 0x1006278a <+1194>: seta %al 0x1006278d <+1197>: fstpl (%esp) 0x10062790 <+1200>: mov %eax,%esi 0x10062792 <+1202>: fstpl 0x50(%esp) 0x10062796 <+1206>: fstpl 0x60(%esp) 0x1006279a <+1210>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006279f <+1215>: mov %esi,%ecx 0x100627a1 <+1217>: movzbl 0x98(%esp),%edi 0x100627a9 <+1225>: movzbl %cl,%ecx 0x100627ac <+1228>: mov %ecx,0xa0(%esp) 0x100627b3 <+1235>: mov 0xa0(%esp),%edx 0x100627ba <+1242>: mov %ebx,%ecx 0x100627bc <+1244>: mov %edi,%eax 0x100627be <+1246>: fstl 0xb0(%esp) 0x100627c5 <+1253>: fldl 0x90(%esp) 0x100627cc <+1260>: fstpl 0x30(%esp) 0x100627d0 <+1264>: fldl 0x60(%esp) 0x100627d4 <+1268>: fstpl 0x28(%esp) 0x100627d8 <+1272>: fstpl 0x20(%esp) 0x100627dc <+1276>: fldl 0x50(%esp) 0x100627e0 <+1280>: fstpl 0x18(%esp) 0x100627e4 <+1284>: fldl 0x88(%esp) 0x100627eb <+1291>: fstpl 0x10(%esp) 0x100627ef <+1295>: fldl 0xc8(%esp) 0x100627f6 <+1302>: fstpl 0x8(%esp) 0x100627fa <+1306>: fldl 0x80(%esp) 0x10062801 <+1313>: fstpl (%esp) 0x10062804 <+1316>: call 0x10061890 <CProfileGenerator::InternalAccCalc(double, double, double, double, double, bo ol, bool, double, double, bool, CProfileGenerator::CProfile&) const> 0x10062809 <+1321>: sub $0x38,%esp 0x1006280c <+1324>: test %eax,%eax 0x1006280e <+1326>: jg 0x10062520 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+576> 0x10062814 <+1332>: mov %esi,%eax 0x10062816 <+1334>: fldl 0xa8(%esp) 0x1006281d <+1341>: cmp $0x1,%al 0x1006281f <+1343>: sbb %edx,%edx 0x10062821 <+1345>: fstpl 0x20(%esp) 0x10062825 <+1349>: or $0x1,%edx 0x10062828 <+1352>: fldl 0xb0(%esp) 0x1006282f <+1359>: lea 0xe8(%esp),%ecx 0x10062836 <+1366>: cmpb $0x1,0x98(%esp) 0x1006283e <+1374>: fstpl 0x10(%esp) 0x10062842 <+1378>: fldl 0xb8(%esp) 0x10062849 <+1385>: lea 0xe0(%esp),%esi 0x10062850 <+1392>: sbb %eax,%eax 0x10062852 <+1394>: fstpl 0x8(%esp) 0x10062856 <+1398>: or $0x1,%eax 0x10062859 <+1401>: fldl 0xc0(%esp) 0x10062860 <+1408>: mov %ecx,0x2c(%esp) 0x10062864 <+1412>: fstpl (%esp) 0x10062867 <+1415>: mov %esi,0x28(%esp) 0x1006286b <+1419>: mov %edx,0x1c(%esp) 0x1006286f <+1423>: mov %eax,0x18(%esp) 0x10062873 <+1427>: call 0x10081410 <CalcLimitAcc(double, double, double, int, int, double, double&, double&)> 0x10062878 <+1432>: test %al,%al 0x1006287a <+1434>: je 0x10062916 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1590> 0x10062880 <+1440>: fldl 0xe0(%esp) 0x10062887 <+1447>: fstl 0x88(%esp) 0x1006288e <+1454>: fstpl (%esp) 0x10062891 <+1457>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062896 <+1462>: fldl 0xe8(%esp) 0x1006289d <+1469>: fstpl (%esp) 0x100628a0 <+1472>: fstpl 0x50(%esp) 0x100628a4 <+1476>: call 0x1005f2e0 <ABS<double>(double const&)> 0x100628a9 <+1481>: fldl 0x50(%esp) 0x100628ad <+1485>: fxch %st(1) 0x100628af <+1487>: fucomip %st(1),%st 0x100628b1 <+1489>: fstp %st(0) 0x100628b3 <+1491>: ja 0x10062e0c <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2860> 0x100628b9 <+1497>: fldl 0x88(%esp) 0x100628c0 <+1504>: fstpl (%esp) 0x100628c3 <+1507>: call 0x1005f310 <SIGN<double>(double const&)> 0x100628c8 <+1512>: fldl 0x90(%esp) 0x100628cf <+1519>: fstpl (%esp) 0x100628d2 <+1522>: mov %eax,0x98(%esp) 0x100628d9 <+1529>: call 0x1005f310 <SIGN<double>(double const&)> 0x100628de <+1534>: cmp %eax,0x98(%esp) 0x100628e5 <+1541>: mov %eax,%esi 0x100628e7 <+1543>: je 0x10062e32 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2898> 0x100628ed <+1549>: fldl 0xe8(%esp) 0x100628f4 <+1556>: fstl (%esp) 0x100628f7 <+1559>: fstpl 0x50(%esp) 0x100628fb <+1563>: call 0x1005f310 <SIGN<double>(double const&)> 0x10062900 <+1568>: cmp %eax,%esi 0x10062902 <+1570>: fldl 0x50(%esp) 0x10062906 <+1574>: je 0x10062cf0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2576> 0x1006290c <+1580>: fstp %st(0) 0x1006290e <+1582>: jmp 0x10062916 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1590> 0x10062910 <+1584>: fstp %st(0) 0x10062912 <+1586>: jmp 0x10062916 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1590> 0x10062914 <+1588>: fstp %st(0) 0x10062916 <+1590>: xor %eax,%eax 0x10062918 <+1592>: jmp 0x10062520 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+576> 0x1006291d <+1597>: lea 0x0(%esi),%esi 0x10062920 <+1600>: jp 0x10062a95 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1973> 0x10062926 <+1606>: jne 0x10062a95 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+1973> 0x1006292c <+1612>: fldl 0xb8(%esp) 0x10062933 <+1619>: fstpl (%esp) 0x10062936 <+1622>: call 0x1005f310 <SIGN<double>(double const&)> 0x1006293b <+1627>: fldl 0x98(%esp) 0x10062942 <+1634>: mov %eax,%esi 0x10062944 <+1636>: fstpl (%esp) 0x10062947 <+1639>: neg %esi 0x10062949 <+1641>: call 0x1005f2e0 <ABS<double>(double const&)> 0x1006294e <+1646>: mov %esi,0xa4(%esp) 0x10062955 <+1653>: fildl 0xa4(%esp) 0x1006295c <+1660>: fmulp %st,%st(1) 0x1006295e <+1662>: jmp 0x1006255f <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+639> 0x10062963 <+1667>: jne 0x100625a0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+704> 0x10062969 <+1673>: fstp %st(0) 0x1006296b <+1675>: fxch %st(2) 0x1006296d <+1677>: fstl (%esp) 0x10062970 <+1680>: fxch %st(1) 0x10062972 <+1682>: fstpl 0x60(%esp) 0x10062976 <+1686>: fstpl 0x50(%esp) 0x1006297a <+1690>: fstpl 0x70(%esp) 0x1006297e <+1694>: call 0x1005f310 <SIGN<double>(double const&)> 0x10062983 <+1699>: fldl 0x60(%esp) 0x10062987 <+1703>: mov %eax,%esi 0x10062989 <+1705>: fstpl (%esp) 0x1006298c <+1708>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062991 <+1713>: mov %esi,0xa4(%esp) 0x10062998 <+1720>: fildl 0xa4(%esp) 0x1006299f <+1727>: fmulp %st,%st(1) 0x100629a1 <+1729>: fstl 0xb0(%esp) 0x100629a8 <+1736>: fldl 0x50(%esp) 0x100629ac <+1740>: fld %st(0) 0x100629ae <+1742>: fdiv %st(2),%st 0x100629b0 <+1744>: fxch %st(1) 0x100629b2 <+1746>: fdivrl 0x80(%esp) 0x100629b9 <+1753>: fsub %st(1),%st 0x100629bb <+1755>: fldl 0x70(%esp) 0x100629bf <+1759>: fucomip %st(1),%st 0x100629c1 <+1761>: ja 0x10062db0 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+2768> 0x100629c7 <+1767>: fstp %st(2) 0x100629c9 <+1769>: fxch %st(1) 0x100629cb <+1771>: fstpl 0x50(%esp) 0x100629cf <+1775>: mov %ebx,%ecx 0x100629d1 <+1777>: fstpl 0x70(%esp) 0x100629d5 <+1781>: call 0x100945e0 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::clear()> 0x100629da <+1786>: mov %ebx,%ecx 0x100629dc <+1788>: call 0x10060820 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::reserve(unsigned int)> 0x100629e1 <+1793>: lea 0xb0(%esp),%eax 0x100629e8 <+1800>: mov %eax,0x14(%esp) 0x100629ec <+1804>: lea 0xb8(%esp),%eax 0x100629f3 <+1811>: mov %eax,0x10(%esp) 0x100629f7 <+1815>: lea 0xc0(%esp),%eax 0x100629fe <+1822>: lea 0x118(%esp),%esi 0x10062a05 <+1829>: mov %eax,0xc(%esp) 0x10062a09 <+1833>: lea 0xc8(%esp),%eax 0x10062a10 <+1840>: mov %esi,%ecx 0x10062a12 <+1842>: mov %eax,0x8(%esp) 0x10062a16 <+1846>: fldz 0x10062a18 <+1848>: fstpl (%esp) 0x10062a1b <+1851>: call 0x1005f2b0 <CProfileStepCalculator::CProfileStep::CProfileStep(CProfileStepCalculator::po s_type const&, CProfileStepCalculator::vel_type const&, CProfileStepCalculator::acc_type const&, CProfileStepCalculator: :jerk_type const&, CProfileStepCalculator::time_type const&)> 0x10062a20 <+1856>: mov %ebx,%ecx 0x10062a22 <+1858>: sub $0x18,%esp 0x10062a25 <+1861>: mov %esi,(%esp) 0x10062a28 <+1864>: call 0x10094760 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::push_back(CProfileStepCalculator::CProfileStep const&)> 0x10062a2d <+1869>: mov %ebx,%eax 0x10062a2f <+1871>: sub $0x4,%esp 0x10062a32 <+1874>: fldl 0x70(%esp) 0x10062a36 <+1878>: fstpl (%esp) 0x10062a39 <+1881>: call 0x10061470 <CProfileGenerator::ProfilePush(CProfileGenerator::CProfile&, double, double) const> 0x10062a3e <+1886>: mov %ebx,%eax 0x10062a40 <+1888>: fldl 0xb0(%esp) 0x10062a47 <+1895>: fchs 0x10062a49 <+1897>: fstpl 0x8(%esp) 0x10062a4d <+1901>: fldl 0x50(%esp) 0x10062a51 <+1905>: fstpl (%esp) 0x10062a54 <+1908>: call 0x10061420 <CProfileGenerator::ProfilePush(CProfileGenerator::CProfile&, double, double) const> 0x10062a59 <+1913>: mov %ebx,%eax 0x10062a5b <+1915>: fldl 0x70(%esp) 0x10062a5f <+1919>: fstpl (%esp) 0x10062a62 <+1922>: call 0x10061470 <CProfileGenerator::ProfilePush(CProfileGenerator::CProfile&, double, double) const> 0x10062a67 <+1927>: mov %ebx,%ecx 0x10062a69 <+1929>: call 0x10094580 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::back()> 0x10062a6e <+1934>: mov %ebx,%ecx 0x10062a70 <+1936>: fldl 0xa8(%esp) 0x10062a77 <+1943>: fstpl 0x10(%eax) 0x10062a7a <+1946>: call 0x10094580 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::back()> 0x10062a7f <+1951>: mov %ebx,%ecx 0x10062a81 <+1953>: fldz 0x10062a83 <+1955>: fstpl 0x18(%eax) 0x10062a86 <+1958>: call 0x10094580 <std::vector<CProfileStepCalculator::CProfileStep, std::allocator<CProfileStep Calculator::CProfileStep> >::back()> 0x10062a8b <+1963>: fldz 0x10062a8d <+1965>: fstpl 0x20(%eax) 0x10062a90 <+1968>: jmp 0x10062516 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+566> 0x10062a95 <+1973>: fldl 0x98(%esp) 0x10062a9c <+1980>: fstpl (%esp) 0x10062a9f <+1983>: call 0x1005f2e0 <ABS<double>(double const&)> 0x10062aa4 <+1988>: fchs 0x10062aa6 <+1990>: jmp 0x1006255f <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+639> 0x10062aab <+1995>: nop 0x10062aac <+1996>: lea 0x0(%esi,%eiz,1),%esi 0x10062ab0 <+2000>: jne 0x10062416 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+310> 0x10062ab6 <+2006>: fstp %st(1) 0x10062ab8 <+2008>: lea 0xe8(%esp),%eax 0x10062abf <+2015>: fstl 0xe8(%esp) 0x10062ac6 <+2022>: mov %eax,0x14(%esp) 0x10062aca <+2026>: lea 0xb8(%esp),%eax 0x10062ad1 <+2033>: mov %eax,0x10(%esp) 0x10062ad5 <+2037>: lea 0xc0(%esp),%eax 0x10062adc <+2044>: mov %eax,0xc(%esp) 0x10062ae0 <+2048>: lea 0xc8(%esp),%eax 0x10062ae7 <+2055>: lea 0x118(%esp),%esi 0x10062aee <+2062>: mov %eax,0x8(%esp) 0x10062af2 <+2066>: fstpl (%esp) 0x10062af5 <+2069>: jmp 0x100624ff <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+543> 0x10062afa <+2074>: lea 0x0(%esi),%esi 0x10062b00 <+2080>: jne 0x10062580 <CProfileGenerator::CalcAccProfile(double, double, double, double, double, dou ble, CProfileGenerator::CProfile&) const+672> 0x10062b06 <+2086>: fstp %st(1) 0x10062b08 <+2088>: fxch %st(1) 0x10062b0a <+2090>: fstpl 0x30(%esp) 0x10062b0e <+2094>: mov %ebx,%ecx 0x10062b10 <+2096>: fldl 0x90(%esp) 0x10062b17 <+2103>: mov $0x1,%edx 0x10062b1c <+2108>: mov $0x1,%eax 0x10062b21 <+2113>: fstpl 0x28(%esp) 0x10062b25 <+2117>: fstl 0x20(%esp) 0x10062b29 <+2121>: fstl 0x18(%esp) 0x10062b2d <+2125>: fldl 0x88(%esp) 0x10062b34 <+2132>: fstpl 0x10(%esp) 0x10062b38 <+2136>: fldl 0xc8(%esp) 0x10062b3f <+2143>: fstpl 0x8(%esp) 0x10062b43 <+2147>: fstpl (%esp) 0x10062b46 <+2150>: call 0x10061890 <CProfileGenerator::InternalAccCalc(double, double, double, double, double, bo ol, bool, double, double, bool, CProfileGenerator::CProfile&) const> 0x10062b4b <+2155>: sub $0x38,%esp 0x10062b4e <+2158>: add $0x14c,%esp 0x10062b54 <+2164>: pop %ebx 0x10062b55 <+2165>: pop %esi 0x10062b56 <+2166>: pop %edi 0x10062b57 <+2167>: pop %ebp 0x10062b58 <+2168>: ret $0x34 ------------------------ ---------------------------------------------------------------------- Comment By: Oleh Derevenko (oleh_derevenko) Date: 2012-12-10 05:54 Message: So, now I get it. You reuse the same stack area for all the calls and just re-adjust stack pointer back to compensate ret <N> instruction in functions being called. With this, the problem is more clear now. It's about the method CProfileGenerator::InternalAccCalc which is being invoked. In function faulting the method is called 4 times from different execution paths. Actually, GCC has generated two instances of CProfileGenerator::InternalAccCalc: at 0x1005aa40 and 0x1005a660, - each of those two instances being called twice. For first instance the stack is adjusted by 0x38 in caller, while for second instance the stack is adjusted by 0x48. However if second instance contains correct "ret 0x48" exit instructions, the first one containg just plain "ret" which causes the stack corruption. Attached is the method's source and disassembled text of two instances generated. The instances are invoked as InternalAccCalc(t0, p0, v0, 0.0, 0.0, true, true, vel, acc, true, ret_profile); // #1 InternalAccCalc(t0, p0, v0, a0, j, z1, z2, vel, acc, true, ret_profile); // #1 InternalAccCalc(t0, p0, v0, a0, j, z1, z2, vel, limit_acc1, false, ret_profile); // #2 InternalAccCalc(t0, p0, v0, a0, j, z1, z2, vel, limit_acc2, false, ret_profile); // #2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3594446&group_id=2435 |