This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/18287] Unaligned access to fields inside packed records
- From: "pinskia 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 18:02:19 -0000
- Subject: [Bug c/18287] Unaligned access to fields inside packed records
- References: <20041103175151.18287.ebotcazou@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-03 18:02 -------
Are you sure that 4.0.0 does not work, as it no longer does the transformation for &(a->b) into a +
offsetof(a,b).
>From the last tree dump for 4.0.0:
;; Function Assign_Hour_Of (Assign_Hour_Of)
Assign_Hour_Of (t)
{
<bb 0>:
t->Hour = 44;
return;
}
;; Function Clobber_Hour_Of (Clobber_Hour_Of)
Clobber_Hour_Of (dt)
{
struct Time_T * D.1128;
<bb 0>:
D.1128 = &dt->Time;
Assign_Hour_Of (D.1128);
return;
}
;; Function main (main)
main ()
{
struct Date_And_Time_T dt;
int D.1135;
<bb 0>:
dt.Time.Hour = 22;
Clobber_Hour_Of (&dt);
D.1135 = 0;
return D.1135;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18287