This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/77353] [AVR] uint16_t instead uint8_t comparison
- 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, 29 Aug 2016 14:11:49 +0000
- Subject: [Bug target/77353] [AVR] uint16_t instead uint8_t comparison
- Auto-submitted: auto-generated
- References: <bug-77353-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77353
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Target|AVR |avr
CC| |gjl at gcc dot gnu.org
Known to fail| |6.2.1
--- Comment #10 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Here is a valid test case (avr/io.h is not available here):
#define PINA (*(unsigned char volatile*) 0x39)
#define PINB (*(unsigned char volatile*) 0x36)
#define PORTC (*(unsigned char volatile*) 0x35)
int main(void)
{
if (PINA < PINB)
{
PORTC = 0;
}
}
== Compile with 6.2 (trunk will work as expected) ==
avr-g++ -S -Os -mmcu=atmega128 main.cpp
Appears to be C++ related as avr-gcc 6.2 uses an 8-bit comparison as expected.