This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
data alignment issue?
Josh dot Loeb at ubsw dot com writes:
> Hi,
>
> I'm trying to set up gcc-3.2.2 for a fairly large code base for a mortgage analytics system. For unfortunate historical reasons, developers and users running SPARC/Solaris 2.8 are compiling with 2.95.3, and those running SPARC/Solaris 5.5.x compile with 2.7-97r2. I'm almost done: the entire code base compiles, the applications run, and I'm testing now. One of the applications has functionality that includes writing out structures (all of which derive from a base class with data) in binary format and reading them back in. It depends on the layout to do this. I've found that the application compiled with 3.2.2 does okay most of the time, but there are certain (reproducible) situations where either memory is getting hammered or the layout is different, so the structs are not being properly re-loaded.
> Is there a difference between how data in structs is laid out since 2.95x that it would help me to know about, or has anyone heard about a similar problem and possible workaround or solution? Thanks in advance for any consideration of the issue.
Yes, there is. This is a problem that was addressed recently, and
there is a bug fix for gcc 3.3 which has just been checked in.
Read the thread which begins at
http://gcc.gnu.org/ml/gcc/2003-03/msg01318.html
In particular, please see
http://gcc.gnu.org/ml/gcc/2003-03/msg01497.html
and
http://gcc.gnu.org/ml/gcc-patches/2003-03/msg02550.html
Andrew.