[Top][All Lists]

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

[avr-gcc-list] dev and mod may not be optimized

From: Nathan Moore
Subject: [avr-gcc-list] dev and mod may not be optimized
Date: Mon, 10 Dec 2007 17:01:51 -0500

I appologize if I'm misunderstanding something about the code that is
being produced, but while auditing some code to try to make some code
smaller I noticed that __udivmodqi4 is being called twice to generate
code for:
        unsigned char a, b, c;
        c = some_input_function();
        a = c/10;
        b = c%10;

        mov r24,r18
        ldi r22,lo8(10)
        call __udivmodqi4
        mov r19,r24
        mov r24,r18
        call __udivmodqi4

If I'm understanding __udivmodqi4 it produces the results of both of
these with one call.  
My compile command is:
avr-gcc -S -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall
-Wstrict-prototypes -Wa,-ahlms=gekv2c.lst -DETHERNUT2 -D__HARVARD_ARCH__
-gdwarf-2 -IC:/ethernut-4.4.0/nut/include file.c -o file.s

And as the -I tells, this is on Windows.  The GCC version is 3.4.6 .

I do not subscribe to this list, so please CC me on any replies.

Nathan Moore

reply via email to

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