PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : VS (2008). /Gr vs. /GL??


(del)
2011-10-29, 13:40:48
Hi

Das verwirrt mich grad bisschen. Beide Optionen können zusammen verwendet werden? Arbeiten die dann nicht kleinwenig gegeneinander? Oder wie wird das dann gelöst?

Trap
2011-10-29, 14:22:55
Die Optionen betreffen beide die calling-conventions, da muss man halt etwas ins Detail gehen. /GL sagt, dass in vielen Fällen die Aufrufe ohne Beachtung der calling-conventions umgesetzt werden können. /Gr wählt dann die calling-convention für die verbleibenden Aufrufe (eventuell gibt es da keine, aber das macht ja nichts).

Gast
2011-10-29, 20:04:02
Hello

There is no need to specify -Gr when -GL is specified.

The -Gr option forces compiler to use the ecx or edx register for the parameter passing of functions. This can cause adverse effects on compiler optimization when compiler must push the contents of the ecx or edx register to the stack before function call. The stack processing spends CPU cycles.

When -GL is specified, compiler can use the CPU registers for function call much more flexibly. /GL can decide the best internal calling convention, such as fastcall, stdcall, cdecl and thiscall. /Gr may overload his judgement, and may generate weird code. /Gr will enforce fastcall.