[Top][All Lists]

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

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

From: Ben Jackson
Subject: [avr-gcc-list] multiply by constant always expands to int
Date: Sat, 3 Dec 2005 20:43:26 -0800
User-agent: Mutt/1.5.6i

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.

Ben Jackson

reply via email to

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