------- Comment #21 from abnikant dot singh at atmel dot com  2010-09-08 09:50 
-------
The head version [gcc version 4.6.0 20100907 (experimental) (GCC)] tends to
inline the attached test case in case of -Os, just because it gets better code
size [see the dump using : -fdump-ipa-inline] by performing inline.
                                   If the test case is changed slightly as
given below, the head version does not perform the inline because without
performing inline it gets better code size.

#ifdef NOINLINE
__attribute__((noinline))
#endif
;

static void wait(int i)
{
        volatile int a = 5;
        while (i-- > 0)
        {
                a = a + i;
        }
         asm volatile("" ::: "memory");
}

int
main(void)
{
        volatile x;
        for (;;) {
                x = 1;
                wait(100);
                x = 0;
                wait(100);
        }

        return 0;
}




-- 

abnikant dot singh at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abnikant dot singh at atmel
                   |                            |dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30908

Reply via email to