[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#530901: gcc: mips cross-compiler generates needlessly slow assembly



Package: gcc
Version: 4.2.4-6

The mips cross-compiler[1] generates assembly which reloads gp (by
adding a constant to t9, the function's address) at the start of every
function.  This would make sense if functions are allowed to change gp.
But AFAIK they aren't.  If they would, gp would need to be restored
after any call to a function as well, and it isn't.

While it doesn't harm the programs in their output, it does result in a
potentially large performance hit, without any reason at all.  Please
let gp be initialized in crt0.s (I didn't check if this is done
already), and remove the code from functions.

Thanks,
Bas Wijnen

[1] I built a cross compiler by using apt-get source binutils and
gcc-4.2 (later versions fail to build).  Then I used
$ TARGET=mipsel-linux-gnu fakeroot debian/rules binary-cross
for building a binutils package and
$ export GCC_TARGET=mipsel
$ export DEB_CROSS_INDEPENDENT=yes
$ debian/rules control
$ dpkg-buildpackage -uc -us -b -rfakeroot
to build the compiler itself (plus some dpkg-cross magic to install some
cross-libraries).

I made no changes to the debian sources.

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://a82-93-13-222.adsl.xs4all.nl/e-mail.html

Attachment: signature.asc
Description: Digital signature


Reply to: