This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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 rtl-optimization/58322] similar simple code produces different (and non-optimal) result


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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-09-30
      Known to work|                            |4.6.2
     Ever confirmed|0                           |1
      Known to fail|                            |4.7.2, 4.8.1

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Confirmed.

test1 should use direct addressing.

With addresses < 0x60 that can use IN/OUT everything is fine; the indirect
addressing starts with adresses >= 0x60:

== Code ==

#define UCSR0B (*(volatile unsigned char*) 0x60)

void test1 (void)
{
    UCSR0B |= 1;
}

void test2 (char flag)
{
    if (flag)
        UCSR0B |= 1;
}


== Command Line ==

$ avr-gcc bug.c -S -Os -mmcu=atmega8 -v

Target: avr
Configured with: ../../gcc.gnu.org/trunk/configure --target=avr
--prefix=/local/gnu/install/gcc-4.8 --enable-languages=c,c++ --disable-nls
--disable-shared --with-dwarf2
Thread model: single
gcc version 4.8.0 20130306 (experimental) (GCC)


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