Hello,

I was using gcc 2.9 (host - i386-pc-cygwin, target –
sparclet-aout). Recently I have started using gcc 3.2
(same host and target) primarily to ge the benefit of
size reduction optimizations in gcc. However I
observed increase in size for many applications when
compiled with gcc3.2. All switches passed to gcc when
compiling with 2.9 and 3.2 are same.
Below are some observations after analyzing assembly
output when –Os is passed to both 2.9 and 3.2 –
1) There is always a ‘nop’ instruction before ‘ret’
instruction in 3.2 output.
e.g.

L72:
        nop
        ret

2) CSE handling in 2.9 and 3.2 is different. It is
more effective in 2.9

e.g
In my program one of the function uses a one structure
variable heavily. In 2.9 the structure base address is
treated as cse -
sethi   %hi(_sInitBootConfig), %l4

while 3.2 does not.

3) Handling of ‘if’ statements is different in 3.2
than 2.9. In 3.2 code fragment which will be executed
when predicate evaluates to true is located some where
else. This increases one jump instruction and
duplication of one delay slot instruction(useful or
‘nop’).

e.g 
source statement:

        if ( GS_TRUE == sInitBootConfig.u32PerformPOST)
                fieldBoot_DoPOST();

code generated by 3.2:
        sethi   %hi(_sInitBootConfig), %o0
        or      %o0, %lo(_sInitBootConfig), %l0
        ld      [%l0+188], %o0  
        cmp     %o0, 1
        mov     0, %l4
        mov     0, %l1
        be      L42             
                                                        
Is there any way to reduce the output size?

Your help will be very much appreciated.

Regards,

Milind



                
__________________________________ 
Discover Yahoo! 
Get on-the-go sports scores, stock quotes, news and more. Check it out! 
http://discover.yahoo.com/mobile.html

Reply via email to