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

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

Re: [avr-gcc-list] efficiency of assigning bits


From: Jim Brain
Subject: Re: [avr-gcc-list] efficiency of assigning bits
Date: Sat, 19 Mar 2005 14:52:11 -0600
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Graham Davies wrote:

This has nothing to do with what the ANSI C specification requires.  This
just indicates that the optimizer has determined that the result will be the
same whether the operands are processed as integers or at their declared
I'll rephrase my statement. In my avr object code produced by GNU GCC concerning the (1<<X) construct, I've only seen the need to explicitly cast ~(1<<X) statements in order to force the optimizer/compiler to not generate integer based code in that circumstance.

You can't "cancel" promotions.  All you can do it take the result of an
operand or expression evaluation and cast (perform an explicit conversion)
to some type.  This is what you are doing here.
Which effectively "cancels" the promotion. I apologize for not using the pedantically correct terminology. I hope other readers were able to understand the essence of the statement.

Jim

--
Jim Brain, Brain Innovations
address@hidden                                http://www.jbrain.com
Dabbling in WWW, Embedded Systems, Old CBM computers, and Good Times!





reply via email to

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