J
J Cook
Typically, when compiling c++ programs using the same gcc 3.4.4
(identically the same compiler in a shared directory), the resulting
binaries match identically between solaris 5.8 (sparc SUNW) and
solaris 5.10 (sparc SUNW).
However, there is exactly one section of code (out of hundreds of
thousands) that produces different assembly output from identical
input.
I don't know if this is a bug in Solaris (which guarantees binary
compatibility), or something with the compiler gcc for powerpc that
incorrectly induces some random element for just this one case.
Short Program:
class Foo
{
public:
void goo(int a,int b,int c);
struct Bar
{
float m_a;
float m_b;
float m_c;
};
Bar m_bar[50][50][50];
};
Foo::goo(int a,int b, int c)
{
m_bar[a][c].m_b = 0;
}
Playing around, it really seems to have something to do
multidimensional arrays where dim>2.
Both assembly outputs are valid (one computes the offset of index "a"
first, and the other computes the offset of index "b" first.), but
they differ.
Any suggestions would be welcome,
JC
(identically the same compiler in a shared directory), the resulting
binaries match identically between solaris 5.8 (sparc SUNW) and
solaris 5.10 (sparc SUNW).
However, there is exactly one section of code (out of hundreds of
thousands) that produces different assembly output from identical
input.
I don't know if this is a bug in Solaris (which guarantees binary
compatibility), or something with the compiler gcc for powerpc that
incorrectly induces some random element for just this one case.
Short Program:
class Foo
{
public:
void goo(int a,int b,int c);
struct Bar
{
float m_a;
float m_b;
float m_c;
};
Bar m_bar[50][50][50];
};
Foo::goo(int a,int b, int c)
{
m_bar[a][c].m_b = 0;
}
Playing around, it really seems to have something to do
multidimensional arrays where dim>2.
Both assembly outputs are valid (one computes the offset of index "a"
first, and the other computes the offset of index "b" first.), but
they differ.
Any suggestions would be welcome,
JC