RE: RE: odd optimization differences of shift between C andC++
Jochen Barth <[email protected]> Tue, 29 Dec 2020 21:00:59 +0100
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <[email protected]> |
I'm using Arduino 1.8.13 with avr-g++ (GCC) 7.3.0. char x; x >>= 5 generates asm (promoted to 16 bit signed) with 5* asr+ror; x = x * (1<<(8-5)) / 256 generates 5* asr (without type promotion). Kind regards, Jochen Weddington, Eric Mon, 08 Nov 2010 04:25:48 -0800 > -----Original Message----- > From: > [email protected] > [mailto:avr-gcc-list-bounces+eric.weddington=atmel....@nongnu. > org] On Behalf Of William "Chops" Westfield > Sent: Sunday, November 07, 2010 9:58 PM > To: [email protected] > Subject: [avr-gcc-list] odd optimization differences of shift > between C andC++ > > > > Is this expected? Is it bug-worthy ? > I would say that it's bug-worthy, as a missed optimization bug. FYI, there are more bugs with the C++ compiler for the AVR than for the C compiler. So I'm not totally surprised that this is happening. BTW, could you please subscribe to the mailing list? That way your posts do not have to be approved by hand. _______________________________________________ AVR-GCC-list mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-gcc-list