This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56394] pointer arithmetic breaks with __attribute__((packed))
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Feb 2013 14:15:18 +0000
- Subject: [Bug c++/56394] pointer arithmetic breaks with __attribute__((packed))
- Auto-submitted: auto-generated
- References: <bug-56394-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56394
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-19 14:15:18 UTC ---
Also reproduces with optimization but with -fno-inline. The issue must be
with the exact division:
D.2616_5 = end.0_3 - beg.1_4;
D.2617_6 = D.2616_5 /[ex] 12;
the difference is 4088 but that does not divide by 12. Which means your
computed end is not correct (the pointers cannot point to elements of
an array of Xyz).