This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26118] New: avr-gcc (GCC) 3.4.5 Bug: copying structure through pointer will destroy the pointer
- From: "cajus dot hahn at de dot abb dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2006 09:17:12 -0000
- Subject: [Bug c/26118] New: avr-gcc (GCC) 3.4.5 Bug: copying structure through pointer will destroy the pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
there is a bug in avr-gcc (GCC) 3.4.5, that comes with the latest WinAVR
distribution (20060125).
The avr-gcc (GCC) 3.4.3, that comes with WinAVR 20050214 does NOT contain this
bug.
The bug exists with and without optimization (I tried -O0 and -Os)
If you try to copy a structure with
*struct_pointer = struct;
the struct_pointer gets destroyed.
The assembler code generated seems to add one structure length foreach copied
byte to the pointer.
The complete code is attached. (there I use *struct_pointer++, but it is the
same problem there).
--
Summary: avr-gcc (GCC) 3.4.5 Bug: copying structure through
pointer will destroy the pointer
Product: gcc
Version: 3.4.5
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cajus dot hahn at de dot abb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26118