- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My understanding is that gcc by default aligns on 4 byte boundaries. The intel option "-align" aligns on "natural" boundaries. which I assume as long as you stay away from long double ( 16 bytes) is aligning on 8.
Is there a gcc 4 switch equivalent? I am only concerned about 64-bit code generation.
Is there a gcc 4 switch equivalent? I am only concerned about 64-bit code generation.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting vasci_intel
...Is there a gcc 4 switch equivalent? I am only concerned about 64-bit code generation.
GCC haslots of align-relatedoptions ( switches ):
gcc -v --help > gcc_options.txt
or
g++ -v --help > gpp_options.txt
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can also use the "-Zp
n-->Is the byte size boundary. Possible values are 1, 2, 4, 8, or 16. (Default:16).
Hope this helps you.
Thanks,
Sukruth H.V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gcc on linux x86_64 normally follows its ABI dictates fairly well, with objects of size 16 bytes or more given 16-byte alignment. I think there were a few early versions which might have set 8-byte alignments under -Os, if so, that could be over-ridden by -mpreferred-stack-boundary=4. I doubt gcc4 would have this problem.
32-bit gcc would drop to 4-byte alignment only under -Os, although 8-byte alignment is frequent.
Admittedly, it seems difficult to look up this question, although, as Sergey said, gcc -v -help gives useful information.
32-bit gcc would drop to 4-byte alignment only under -Os, although 8-byte alignment is frequent.
Admittedly, it seems difficult to look up this question, although, as Sergey said, gcc -v -help gives useful information.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page