------- Comment #4 from lmorrison at nautel dot com  2006-02-06 19:54 -------
(From update of attachment 10792)
assembly output from previous preprocessed source

Generated with commandline:
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -DF_CPU=8000000UL  -Os -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=main.lst  -std=gnu99 -MD -MP -MF .dep/main.o.d main.c -o main.o 

Using gcc 3.4.5 on Win32 host, avr target.

In the first two examples ( *ptr++ = struct; and memcpy(ptr++, &struct,
sizeof(struct)); ) the source pointer is being incremented by sizeof(struct)
for each byte being copied.

In the third example, the pointer increment is set aside as a distinct
statement.  Here, things behave as expected.


-- 


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

Reply via email to