public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: target/7559: kdelibs miscompilation
@ 2002-10-06  9:55 aj
  0 siblings, 0 replies; 7+ messages in thread
From: aj @ 2002-10-06  9:55 UTC (permalink / raw)
  To: aj, david, gbeauchesne, gcc-bugs, gcc-prs, jh, nobody

Synopsis: kdelibs miscompilation

State-Changed-From-To: open->closed
State-Changed-By: aj
State-Changed-When: Sun Oct  6 09:55:23 2002
State-Changed-Why:
    I'm going to commit the testcase to the testsuite.  The
    bug is fixed  on both mainline and 3.2 branch with these patches :
    Mon Aug 12 12:48:20 CEST 2002  Jan Hubicka  <jh@suse.cz>
    
    
            * i386.c (classify_argument): Fix missed case from previous patch.
    
    Sun Aug 11 14:43:17 CEST 2002  Jan Hubicka  <jh@suse.cz>
    
            * i386.c (classify_argument): Fix computing of field's offsets.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7559


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: target/7559: kdelibs miscompilation
@ 2002-08-11  9:46 Andreas Jaeger
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Jaeger @ 2002-08-11  9:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/7559; it has been noted by GNATS.

From: Andreas Jaeger <aj@suse.de>
To: Jan Hubicka <jh@suse.cz>
Cc: Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>,
	gcc-gnats@gcc.gnu.org, david@mandrakesoft.com, nobody@gcc.gnu.org,
	gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: target/7559: kdelibs miscompilation
Date: Sun, 11 Aug 2002 15:22:33 +0200

 Honza,
 
 since you fixed this bug: Can you add the testcase to the testsuite,
 please?  Please also remember to close the PR.
 
 Thanks a lot for the quick patch,
 Andreas
 
 Jan Hubicka <jh@suse.cz> writes:
 
 >> 3) The last testcase is ultra-reduced to a two eightbytes object, with 
 >> only one member in each one. That one do fails.
 >> 
 >> extern void abort();
 >> 
 >> struct A {
 >>   long x;
 >> };
 >> 
 >> struct R {
 >>   struct A a, b;
 >> };
 >> 
 >> struct R R = {
 >>   100, 200
 >> };
 >> 
 >> void f(struct R r) {
 >>   if (r.a.x != R.a.x || r.b.x != R.b.x)
 >>     abort();
 >> }
 >> 
 >> int main() {
 >>   f(R);
 >>   return 0;
 >> }
 >
 > This looks like a bug in code computing offests of nested aggregates.  I
 > am just checking it.
 > Thanks a lot for reducing the testcase! This is really usefull one :)
 >
 > Honza
 >> 
 >> 4) The <struct.c> testcase won't fail if we add some garbage in struct R, 
 >> because the size of the object will be > 16 bytes, thus having MEMORY 
 >> class.
 >> 
 >> HTH,
 >> Gwenole.
 >
 -- 
  Andreas Jaeger
   SuSE Labs aj@suse.de
    private aj@arthur.inka.de
     http://www.suse.de/~aj


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: target/7559: kdelibs miscompilation
@ 2002-08-10  6:46 Jan Hubicka
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Hubicka @ 2002-08-10  6:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/7559; it has been noted by GNATS.

From: Jan Hubicka <jh@suse.cz>
To: Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
Cc: gcc-gnats@gcc.gnu.org, david@mandrakesoft.com, aj@suse.de,
	jh@suse.cz, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	gcc-bugs@gcc.gnu.org
Subject: Re: target/7559: kdelibs miscompilation
Date: Sat, 10 Aug 2002 15:14:14 +0200

 > 3) The last testcase is ultra-reduced to a two eightbytes object, with 
 > only one member in each one. That one do fails.
 > 
 > extern void abort();
 > 
 > struct A {
 >   long x;
 > };
 > 
 > struct R {
 >   struct A a, b;
 > };
 > 
 > struct R R = {
 >   100, 200
 > };
 > 
 > void f(struct R r) {
 >   if (r.a.x != R.a.x || r.b.x != R.b.x)
 >     abort();
 > }
 > 
 > int main() {
 >   f(R);
 >   return 0;
 > }
 
 This looks like a bug in code computing offests of nested aggregates.  I
 am just checking it.
 Thanks a lot for reducing the testcase! This is really usefull one :)
 
 Honza
 > 
 > 4) The <struct.c> testcase won't fail if we add some garbage in struct R, 
 > because the size of the object will be > 16 bytes, thus having MEMORY 
 > class.
 > 
 > HTH,
 > Gwenole.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: target/7559: kdelibs miscompilation
@ 2002-08-10  6:16 Gwenole Beauchesne
  0 siblings, 0 replies; 7+ messages in thread
From: Gwenole Beauchesne @ 2002-08-10  6:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/7559; it has been noted by GNATS.

From: Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
To: gcc-gnats@gcc.gnu.org
Cc: david@mandrakesoft.com, <aj@suse.de>, <jh@suse.cz>, <nobody@gcc.gnu.org>,
        <gcc-prs@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>
Subject: Re: target/7559: kdelibs miscompilation
Date: Sat, 10 Aug 2002 13:54:00 +0200 (CEST)

 > The following C testcase is equivalent in miscompiled-behavior. If you
 > don't want to bother compiling the C++ front-end for tests. ;-)
 
 This could be a mis-classification of the other eightbyte sub-object. 
 
 1) Actually, the following testcase fails too and occurs because we have a
 two eightbytes object, "sliced" in the middle (aka two sub-aggregates). As
 a result, only the first eightbyte is actually passed in register. The
 other one vanished.
 
 [gb@gauss vrac]$ cat struct.c
 extern void abort();
 
 struct A {
   int x, y;
 };
 
 struct R {
   struct A a, b;
 };
 
 struct R R = {
   { 100, 100 },
   { 200, 200 }
 };
 
 void f(struct R r) {
   if (r.a.x != R.a.x || r.a.y != R.a.y || r.b.x != R.b.x || r.b.y != 
 R.b.y)
     abort();
 }
 
 int main() {
   f(R);
   return 0;
 }
 
 2) The following testcase *won't* fail though we have a two eightbytes 
 object, and is not "sliced" in.
 
 [gb@gauss vrac]$ cat other.c
 extern void abort();
 
 struct A {
   int a, b, c, d;
 };
 
 struct A X = {
   100, 200, 300, 400
 };
 
 void f(struct A x) {
   if (x.a != X.a || x.b != X.b || x.c != X.c || x.d != X.d)
     abort();
 }
 
 int main(void) {
   f(X);
   return 0;
 }
 
 3) The last testcase is ultra-reduced to a two eightbytes object, with 
 only one member in each one. That one do fails.
 
 extern void abort();
 
 struct A {
   long x;
 };
 
 struct R {
   struct A a, b;
 };
 
 struct R R = {
   100, 200
 };
 
 void f(struct R r) {
   if (r.a.x != R.a.x || r.b.x != R.b.x)
     abort();
 }
 
 int main() {
   f(R);
   return 0;
 }
 
 4) The <struct.c> testcase won't fail if we add some garbage in struct R, 
 because the size of the object will be > 16 bytes, thus having MEMORY 
 class.
 
 HTH,
 Gwenole.
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: target/7559: kdelibs miscompilation
@ 2002-08-09 11:06 Gwenole Beauchesne
  0 siblings, 0 replies; 7+ messages in thread
From: Gwenole Beauchesne @ 2002-08-09 11:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/7559; it has been noted by GNATS.

From: Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
To: gcc-gnats@gcc.gnu.org
Cc: david@mandrakesoft.com, <aj@suse.de>, <jh@suse.cz>, <nobody@gcc.gnu.org>,
        <gcc-prs@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>
Subject: Re: target/7559: kdelibs miscompilation
Date: Fri, 9 Aug 2002 19:13:46 +0200 (CEST)

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: target/7559: kdelibs miscompilation
@ 2002-08-09 10:16 Gwenole Beauchesne
  0 siblings, 0 replies; 7+ messages in thread
From: Gwenole Beauchesne @ 2002-08-09 10:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/7559; it has been noted by GNATS.

From: Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
To: gcc-gnats@gcc.gnu.org
Cc: david@mandrakesoft.com, <aj@suse.de>, <jh@suse.cz>, <nobody@gcc.gnu.org>,
        <gcc-prs@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>
Subject: Re: target/7559: kdelibs miscompilation
Date: Fri, 9 Aug 2002 18:56:17 +0200 (CEST)

 > >Release:        MDK gcc 3.1.1-1mdk, SuSE gcc-3.1-8
 
 Also verified to fail with:
 GNU C++ version 3.2 20020809 (prerelease) (x86_64-unknown-linux-gnu)
         compiled by GNU C version 3.2 20020809 (prerelease).
 
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* target/7559: kdelibs miscompilation
@ 2002-08-09  9:56 gbeauchesne
  0 siblings, 0 replies; 7+ messages in thread
From: gbeauchesne @ 2002-08-09  9:56 UTC (permalink / raw)
  To: gcc-gnats; +Cc: david, aj, jh


>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:


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-10-06 16:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06  9:55 target/7559: kdelibs miscompilation aj
  -- strict thread matches above, loose matches on Subject: below --
2002-08-11  9:46 Andreas Jaeger
2002-08-10  6:46 Jan Hubicka
2002-08-10  6:16 Gwenole Beauchesne
2002-08-09 11:06 Gwenole Beauchesne
2002-08-09 10:16 Gwenole Beauchesne
2002-08-09  9:56 gbeauchesne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).