This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1001528] compat/posix: porting to GCC 4.6


Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001528

--- Comment #3 from Sergei Gavrikov <sergei.gavrikov@gmail.com> 2012-03-13 12:34:09 GMT ---
Sorry, for delayed answer. Snippets are below:

 tests/signal2.c:128
    volatile int x;
    volatile CYG_ADDRESS p=(CYG_ADDRESS) &jbuf;

    do
    {
        x = *(volatile int *)(p);
        p += (CYG_ADDRESS)0x100000;
    } while( p != (CYG_ADDRESS)&jbuf );

 GCC 4.3 (-O2)
 16c:   e58d400c        str     r4, [sp, #12]
 170:   e1a00004        mov     r0, r4
 174:   e59d300c        ldr     r3, [sp, #12]
 178:   e5932000        ldr     r2, [r3]
 17c:   e58d2010        str     r2, [sp, #16]
 180:   e59d300c        ldr     r3, [sp, #12]
 184:   e2833601        add     r3, r3, #1048576        ; 0x100000
 188:   e58d300c        str     r3, [sp, #12]
 18c:   e59d200c        ldr     r2, [sp, #12]
 190:   e1500002        cmp     r0, r2
 194:   1afffff6        bne     174 <main+0x174>

 GCC 4.6 (-O2)
 158:   e58d4014        str     r4, [sp, #20]
 15c:   e59d3014        ldr     r3, [sp, #20]
 160:   e5933000        ldr     r3, [r3]
 164:   e58d3010        str     r3, [sp, #16]
 168:   e59d3014        ldr     r3, [sp, #20]
 16c:   e2833601        add     r3, r3, #1048576        ; 0x100000
 170:   e58d3014        str     r3, [sp, #20]
 174:   e59d3014        ldr     r3, [sp, #20]
 178:   e1540003        cmp     r4, r3
 17c:   1afffff6        bne     15c <main+0x15c>

Thus, new compiler uses less registers, but, GCC 4.6 provides the same
functionality (I tested the loop in GDB, and I got `sigbus' call at the
end with new code). Though, you are right, a using CYGBLD_ATTRIB_UNUSED
for the forced volatile variables would break smart things.

Then, maybe leave signal2 test without the changes as I tested the code
for one CPU only? What is your verdict?

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]