This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: target/7559: kdelibs miscompilation


> Also verified to fail with:
> GNU C++ version 3.2 20020809 (prerelease) (x86_64-unknown-linux-gnu)

The following C testcase is equivalent in miscompiled-behavior. If you
don't want to bother compiling the C++ front-end for tests. ;-)

extern void abort();

struct A {
  int x, y;
};

struct B {
  int x, y;
};

struct R {
  struct A a;
  struct B b;
};

struct R X = { { 100, 100 }, { 100, 100 } };

struct R get() {
  return X;
}

int main() {
  struct R r = get();
  
  if (!(r.a.x == 100 && r.a.y == 100
        && r.b.x == 100 && r.b.y == 100))
    abort();
  
  return 0;
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]