UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 23144

8.1 EDK, GNU - The code size of my application in increased after using the 8.1i GNU compiler. Why?

Description

After compiling my application with the 8.1 GNU compilers, my code size increased significantly. Why does this happen?

Solution

The GNU compiler in EDK 8.1 includes an algorithm change which effects code optimization when no barrel shifter is present. The -O3 option is not optimally optimizing the code in this case. For long shifts (N), it used to use an N-times loop with a single bit shift, instead of spitting out a long series of SRL instructions. The former is low on code size, and the latter is very fast.

So when you compile using -O2 or -O3 in EDK 8.1i you will see the latter "faster" code. When you compile with -Os (size optimization) you will see smaller (original) code.

AR# 23144
Date Created 09/04/2007
Last Updated 12/15/2012
Status Active
Type General Article