[Top][All Lists]

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

Re: [avr-gcc-list] multiply by constant always expands to int

From: Eric Weddington
Subject: Re: [avr-gcc-list] multiply by constant always expands to int
Date: Mon, 05 Dec 2005 09:04:09 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Ben Jackson wrote:
Using 3.4.4 (I'm off 4.0.1 for now because I haven't had time to figure
out why all loop variables are promoted to ints) I had a strange experience
where changing:

        char x = 10, y;

        loop {
                f(x * y);

got *longer* when I made it 'const char x = 10' or just hardcoded 10.
Turns out to be because mulqi was replaced with mulhi which is longer.
Now I'm not 100% sure what the integral type promotion rules say for
multiply, but I'd be surprised if they were different for const char
vs char, especially if the *const* version widens *more*.

Where's most of the development going on now, 3.x or 4.x?  I guess I
need to buckle down and read the gcc internals docs and start
submitting patches.

I can't say why you are seeing what you describe above. But I know that the vast majority of new development work (especially in the AVR port) is being done in 4.x and specifically in the GCC SVN HEAD which will become GCC 4.1 upon release.

Björn Hasse could probably better answer your question about GCC internals.

Eric Weddington

reply via email to

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