From: SourceForge.net <no...@so...> - 2007-02-17 21:10:38
|
Bugs item #1662344, was opened at 2007-02-18 03:29 Message generated for change (Settings changed) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1662344&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: Known Feature >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Libor Kadlcik (kadlsoft) Assigned to: Danny Smith (dannysmith) Summary: PUSH would be better for storing function's arguments to sta Initial Comment: GCC version: 3.4.5 (mingw special) LD version: 2.15.91 20040904 OS version: Windows XP Professional mingw run-time version: 3.9 w32api version: 3.6 Description: GCC in MinGW generates code that uses MOV instructions (two per arg.) to store function's arguments to stack. It would be better to use PUSH instruction to store arguments, beacuse it results in smaller code. Compile "bug.c" (I use "gcc bug.c -o bug.exe"). In output .exe file the piece of code for calling the function "function" is: 0040130F A1 90404000 MOV EAX,DWORD PTR DS:[404090] //Load value 00401314 894424 04 MOV DWORD PTR SS:[ESP+4],EAX //Store to stack 00401318 A1 80404000 MOV EAX,DWORD PTR DS:[404080] 0040131D 890424 MOV DWORD PTR SS:[ESP],EAX 00401320 E8 BBFFFFFF CALL 004012E0 //Call function This code would be better (i.e. smaller): PUSH DWORD ptr DS:[404090] PUSH DWORD ptr DS:[404080] CALL 004012E0 ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2007-02-18 10:10 Message: Logged In: YES user_id=11494 Originator: NO Please read the gcc documentation on -maccumulate-outgoing-args (which is on by default with -mtune=-i686) and -mpush-args. You can override the defaults if you like. Or take your case to the gcc developers on the gcc mailing list Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1662344&group_id=2435 |