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]

target/7559: kdelibs miscompilation


>Number:         7559
>Category:       target
>Synopsis:       kdelibs miscompilation
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 09 09:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gwenole Beauchesne
>Release:        MDK gcc 3.1.1-1mdk, SuSE gcc-3.1-8
>Organization:
>Environment:
x86_64-mandrake-linux-gnu
>Description:
kdecore from kdelibs 3.0.2 is miscompiled on x86-64.
>How-To-Repeat:
The following testcase, extracted from kdecore/kwinmodule.cpp (KWinModule::workArea) and kdecore/netwm.cpp (NETRootInfo::workArea) will produce incorrect results in any case but with inlining.

<testcase>
extern void abort();

struct A {
	A() : x(100), y(100) { }
	int x, y;
};

struct B {
	B() : x(100), y(100) { }
	int x, y;
};

struct R {
	A a;
	B b;
};

class X {
	R x;
public:
	R get() const;
};

R X::get() const {
	return x;
}

int main() {
	X x;
	R r = x.get();
	
	if (!(r.a.x == 100 && r.a.y == 100
		  && r.b.x == 100 && r.b.y == 100))
		abort();
	
    return 0;
}
</testcase>

A net visible effect is KDesktop window size being reduced to 0x0, 1x0.
>Fix:
No workaround known yet.
>Release-Note:
>Audit-Trail:
>Unformatted:


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