>From AVR Freaks forum:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=453770#453770

Adding an offset to a pointer to a structure. If the structure size is 16, the
generated code is a loop with shifts. If the structure size is 17, the
generated code uses MUL* instructions and generates shorter code than when the
size is 16.

Command lines:
avr-gcc -save-temps -Os -mmcu=atmega32 -c test.c -o test.o
avr-gcc -save-temps -Os -mmcu=atmega32 -c test2.c -o test2.o

See the code generation of funct().

Test cases to follow...


-- 
           Summary: [avr] Missed optimization with pointer arithmetic and
                    mul*
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eric dot weddington at atmel dot com
GCC target triplet: avr-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36467

Reply via email to