Stack Boundary

Mike mgoppold5@yahoo.com
Sun Aug 18 06:52:00 GMT 2013


I cannot seem to send my ZIP file as an attachment.  Email gets lost.

On 8/18/2013 2:49 AM, Mike wrote:
> Hello.
>
> On 8/18/2013 2:31 AM, Mike wrote:
>> Using GCC 4.7.2 in MINGW.
>>
>> Cannot figure out the code generated for "
>> -mpreferred-stack-boundary=7".  If you understand the generated code,
>> please explain.
>>
>> I compiled a sample program I wrote (attached), disassembled it, and
>> looked at the important instruction "sub esp,ALIGN_CONSTANT" in each of
>> the functions.
>>
>> With a -mpreferred-stack-boundary setting of 7, that means each function
>> should be aligned to 128 bytes, or 0x80 bytes.
>>
>> But these are the results of ALIGN_CONSTANT
>>
>> FUNCTION,ALIGN_CONSTANT
>> start,0x178
>> sum,0x8C
>> m,0x178
>>
>> I would think ALIGN_CONSTANT should be closer to 128 minus a small value
>> for all 3 functions.  But 0x178 and 0x8c?
>>
>>
>>
>



More information about the Gcc-help mailing list