FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 07-12-2012, 04:52 PM
Neil Williams
 
Default Bug#667341: optimisation tests

Dropping the optimisation on src/libraries/qmfclient/ from -O2 to -O1 fixes the issue:

# objdump -C -t src/libraries/qmfclient/build/libqmfclient.so.1.0.0 |grep QMailThreadSort|grep serial|cut -d' ' -f5-
F .text 0000000000000012 void QMailThreadSortKey::serialize<QDataStream>(QDataSt ream&) const
F .text 00000000000000a1 void MailSortKeyImpl<QMailThreadSortKey>::deserialize<Q DataStream>(QDataStream&)
F .text 0000000000000048 void QMailThreadSortKey::deserialize<QDataStream>(QData Stream&)
F .text 00000000000000cb void MailSortKeyImpl<QMailThreadSortKey>::serialize<QDa taStream>(QDataStream&) const

.. albeit defining a pair of new symbols...

The functions themselves are public.

class QMF_EXPORT QMailThreadSortKey
{
public:
enum Property
{
Id,
ServerUid
};

typedef QMailSortKeyArgument<Property> ArgumentType;

public:
<snip>
bool isEmpty() const;

const QList<ArgumentType> &arguments() const;

template <typename Stream> void serialize(Stream &stream) const;
template <typename Stream> void deserialize(Stream &stream);

Why is gcc-4.7 overriding the class and optimising away a public symbol
in -O2 when it does not in -O1 or in gcc-4.6 with -O2?

--


Neil Williams
=============
http://www.linux.codehelp.co.uk/
 
Old 07-14-2012, 01:08 AM
Matthias Klose
 
Default Bug#667341: optimisation tests

please could you find out, which object files (if there are more than one) do
export this symbol for a -O1 build, and attach the preprocessed source and
command line options for these file(s)?



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5000C679.1090609@debian.org">http://lists.debian.org/5000C679.1090609@debian.org
 
Old 07-14-2012, 06:02 PM
Neil Williams
 
Default Bug#667341: optimisation tests

On Sat, 14 Jul 2012 03:08:09 +0200
Matthias Klose <doko@debian.org> wrote:

> please could you find out, which object files (if there are more than one) do
> export this symbol for a -O1 build, and attach the preprocessed source and
> command line options for these file(s)?

shell script and gzip'd pre-processed cpp file attached. I've tested in a
clean pbuilder chroot and the results for gcc-4.7 demonstrate the bug:


# sh 667341.sh
Starting with -O1
Checking for deserialize symbol:
0000000000003714 w F .text 00000000000000a1 void MailSortKeyImpl<QMailThreadSortKey>::deserialize<Q DataStream>(QDataStream&)
0000000000003c40 w F .text 0000000000000048 void QMailThreadSortKey::deserialize<QDataStream>(QData Stream&)
Changing to -O2
Checking for deserialize symbol:
#

(shell script doesn't currently decompress the .cpp.gz)

shell script basically does:

# Line for pre-processed cpp file
g++ -c -pipe -O1 -Wall -W -fPIC -o qmailthreadsortkey.o qmailthreadsortkey.cpp
g++ -Wl,-O1 -shared -Wl,-soname,libqmfclient.so.1 -o libqmfclient.so.1.0.0 qmailthreadsortkey.o -L/usr/lib/${LIBDIR} -lpthread
objdump -C -t libqmfclient.so.1.0.0|grep deserialize
g++ -c -pipe -O2 -Wall -W -fPIC -o qmailthreadsortkey.o qmailthreadsortkey.cpp
g++ -Wl,-O2 -shared -Wl,-soname,libqmfclient.so.1 -o libqmfclient.so.1.0.0 qmailthreadsortkey.o -L/usr/lib/${LIBDIR} -lpthread
objdump -C -t libqmfclient.so.1.0.0|grep deserialize

where LIBDIR is /usr/lib/ followed by `dpkg-architecture -qDEB_HOST_MULTIARCH`
- might not be necessary.

HTH

--


Neil Williams
=============
http://www.linux.codehelp.co.uk/
 
Old 07-14-2012, 06:28 PM
Neil Williams
 
Default Bug#667341: optimisation tests

On Sat, 14 Jul 2012 20:12:45 +0200
Matthias Klose <doko@debian.org> wrote:

> On 14.07.2012 20:02, Neil Williams wrote:
> > On Sat, 14 Jul 2012 03:08:09 +0200 Matthias Klose <doko@debian.org> wrote:
> >
> >> please could you find out, which object files (if there are more than
> >> one) do export this symbol for a -O1 build, and attach the preprocessed
> >> source and command line options for these file(s)?
> >
> > shell script and gzip'd pre-processed cpp file attached. I've tested in a
> > clean pbuilder chroot and the results for gcc-4.7 demonstrate the bug:
> [...]
> > objdump -C -t libqmfclient.so.1.0.0|grep deserialize
>
> no, the dump/grep is needed for each .o file in libqmfclient.so.1.0.0. and the
> preprocessed source for each matching .o file.

There is only one .o file needed for this test, so the adapted script
is attached. The pre-processed cpp doesn't change with optimisation.

Output also attached.

--


Neil Williams
=============
http://www.linux.codehelp.co.uk/
 

Thread Tools




All times are GMT. The time now is 07:19 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org