avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: RE: [avr-gcc-list] odd optimization differences of shift between C a


From: Jochen Barth
Subject: RE: RE: [avr-gcc-list] odd optimization differences of shift between C andC++
Date: Tue, 29 Dec 2020 21:00:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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: 
> avr-gcc-list-bounces+eric.weddington=atmel....@nongnu.org 
> [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: avr-gcc-list@nongnu.org
> 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
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]