target/7559: kdelibs miscompilation

Gwenole Beauchesne gbeauchesne@mandrakesoft.com
Fri Aug 9 10:14:00 GMT 2002


> 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;
}




More information about the Gcc-bugs mailing list