This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/18287] New: Unaligned access to fields inside packed records
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Nov 2004 17:51:54 -0000
- Subject: [Bug c/18287] New: Unaligned access to fields inside packed records
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The testcase I'm about to attach generates a bug error at runtime on the SPARC
(and very likely on any other STRICT_ALIGNMENT target). Verified with 2.95.3,
3.3.x, 3.4.x and 4.0pre.
I think the front-end wrongly turns ADDR_EXPR<COMPONENT_REF<INDIRECT_REF>> into
PLUS_EXPR whatever the alignment of the field. For reference, the Ada front-end
doesn't do the simplification and lets the middle-end generate the temporary if
required.
--
Summary: Unaligned access to fields inside packed records
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ebotcazou at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: *-*-*
GCC host triplet: *-*-*
GCC target triplet: *-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18287