Ben Hutchings | 23 Nov 23:41

Bug#490999: kicker: crashes on startup

This is due to a compiler bug.  The first two instructions of the
function QTime::addMSecs(int) are:

0xf7ce212c <_ZNK5QTime8addMSecsEi+0>:	save  %sp, -112, %sp
0xf7ce2130 <_ZNK5QTime8addMSecsEi+4>:	ld  [ %sp + 0x40 ], %i5

The second instruction is supposed to load the address where the
returned QTime object should be stored.  The calling convention is that
this is passed at 64 bytes above the stack pointer.  But it is using the
value of %sp *after* modification by the preceding save instruction, so
it reads random garbage.

These instructions should be generated in the opposite order, or the %sp
in the second instruction changed to %fp.  I have confirmed that the
latter change (replace opcode 0xfa03a040 with 0xfa07a040) causes the
test program to run successfully.

Ben.

Ben Hutchings | 24 Nov 00:48

Bug#506713: g++-4.3: Incorrect code in SPARC shared libraries

Package: g++-4.3
Version: 4.3.2-1
Severity: serious

Functions compiled for SPARC with both -O2 and -fPIC options, which
return structures and require global data, may have incorrect code
generated for them.

The following example is based on Qt 3, which is affected by this bug
(see #490999).  The code should of course print "1 + 1 = 2" but when
compiled for SPARC with -O2 -fPIC it prints "1 + 1 = 0" (or may crash).
The first two instructions generated for QTime::addMSecs() are a save
using %sp and a load relative to %sp which depends on the *old* value of
%sp.

This example appears to be compiled correctly if I remove either option
or reduce the value of MSECS_PER_DAY such that it can be an immediate
constant.

Ben.

#include <iostream>

class QTime
{
public:
    explicit QTime(int ms = 0) : ds(ms) {}
    static QTime currentTime() { return QTime(); }
    QTime addMSecs(int ms) const;
    int msecs() const { return ds; }
(Continue reading)

Matthias Klose | 24 Nov 01:11
Favicon

Bug#506713: g++-4.3: Incorrect code in SPARC shared libraries

Ben Hutchings schrieb:
> Functions compiled for SPARC with both -O2 and -fPIC options, which
> return structures and require global data, may have incorrect code
> generated for them.

please could you recheck with gcc-4.3 from experimental, and gcc-snapshot?

  Matthias

Ben Hutchings | 24 Nov 01:31

Bug#506713: g++-4.3: Incorrect code in SPARC shared libraries

On Mon, 2008-11-24 at 01:11 +0100, Matthias Klose wrote:
> Ben Hutchings schrieb:
> > Functions compiled for SPARC with both -O2 and -fPIC options, which
> > return structures and require global data, may have incorrect code
> > generated for them.
> 
> please could you recheck with gcc-4.3 from experimental, and gcc-snapshot?

Not easily.  I used sperger to investigate this and don't have my own
SPARC system set up.

Ben.

Baurzhan Ismagulov | 24 Nov 11:30

Bug#506713: g++-4.3: Incorrect code in SPARC shared libraries

On Mon, Nov 24, 2008 at 01:11:48AM +0100, Matthias Klose wrote:
> > Functions compiled for SPARC with both -O2 and -fPIC options, which
> > return structures and require global data, may have incorrect code
> > generated for them.
> 
> please could you recheck with gcc-4.3 from experimental, and gcc-snapshot?

The problem exists in experimental but not in gcc-snapshot.

With kind regards,
--

-- 
Baurzhan Ismagulov
http://www.kz-easy.com/

Bug#506713: marked as done ([PR38287, fixed in 4.4] Incorrect code in SPARC shared libraries)


Your message dated Mon, 01 Dec 2008 07:47:23 +0000
with message-id <E1L73V5-0003BX-3c <at> ries.debian.org>
and subject line Bug#506713: fixed in gcc-4.3 4.3.2-2~exp4
has caused the Debian Bug report #506713,
regarding [PR38287, fixed in 4.4] Incorrect code in SPARC shared libraries
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner <at> bugs.debian.org
immediately.)

--

-- 
506713: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506713
Debian Bug Tracking System
Contact owner <at> bugs.debian.org with problems
From: Ben Hutchings <ben <at> decadent.org.uk>
Subject: g++-4.3: Incorrect code in SPARC shared libraries
Date: 2008-11-23 23:48:07 GMT
(Continue reading)

Bug#506713: marked as done ([PR38287, fixed in 4.4] Incorrect code in SPARC shared libraries)


Your message dated Fri, 02 Jan 2009 03:32:16 +0000
with message-id <E1LIalk-00014n-Pp <at> ries.debian.org>
and subject line Bug#506713: fixed in gcc-4.3 4.3.2-1.1
has caused the Debian Bug report #506713,
regarding [PR38287, fixed in 4.4] Incorrect code in SPARC shared libraries
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner <at> bugs.debian.org
immediately.)

--

-- 
506713: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506713
Debian Bug Tracking System
Contact owner <at> bugs.debian.org with problems
From: Ben Hutchings <ben <at> decadent.org.uk>
Subject: g++-4.3: Incorrect code in SPARC shared libraries
Date: 2008-11-23 23:48:07 GMT
(Continue reading)


Gmane