This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/58322] similar simple code produces different (and non-optimal) result
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Sep 2013 15:47:41 +0000
- Subject: [Bug rtl-optimization/58322] similar simple code produces different (and non-optimal) result
- Auto-submitted: auto-generated
- References: <bug-58322-4 at http dot gcc dot gnu dot org/bugzilla/>
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)