Re: optimization options not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I will try to be descriptive this time .

This is test.c

 main()
  {
  int a,b,c;
   a= 5;
   b=10;
   d=30;
  c=  a*b + 30 ;
}

now , suppose i build gcc for an ARM processor.
After build, compile stage ---

with no optimization options as mentioned above, this is what i get in
assembly.

        .file   "test1234.c"
        .text
        .align  2
        .global main
        .type   main, %function
main:
        @ args = 0, pretend = 0, frame = 16
        @ frame_needed = 1, uses_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {fp, ip, lr, pc}
        sub     fp, ip, #4
        sub     sp, sp, #16
        mov     r3, #5
        str     r3, [fp, #-28]
        mov     r3, #10
        str     r3, [fp, #-24]
        mov     r3, #30
        str     r3, [fp, #-16]
        ldr     r2, [fp, #-28]
        ldr     r3, [fp, #-24]
        mul     r1, r3, r2
        mov     r3, r1
        mov     r2, r3, asl #2
        mov     r3, r2, asl #5
        rsb     r3, r2, r3
        add     r3, r3, r1
        mov     r2, r3, asl #2
        add     r3, r3, r2
        mov     r3, r3, asl #4
        add     r3, r3, #299008
        add     r3, r3, #992
        str     r3, [fp, #-20]
        sub     sp, fp, #12
        ldmfd   sp, {fp, sp, pc}
        .size   main, .-main


   
-- 
View this message in context: http://old.nabble.com/optimization-options-not-working-tp27637400p27714105.html
Sent from the gcc - Help mailing list archive at Nabble.com.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux