From: Christophe Saout <christophe@saout.de>
To: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>
Cc: gcc@gcc.gnu.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
jakub@redhat.com, Gerold Jury <gerold.ml@inode.at>,
Jan Hubicka <hubicka@ucw.cz>, Andrew Morton <akpm@osdl.org>
Subject: Re: [BUG mm] "fixed" i386 memcpy inlining buggy
Date: Wed, 06 Apr 2005 14:05:57 +0200 [thread overview]
Message-ID: <1112789157.32279.13.camel@leto.cs.pocnet.net> (raw)
In-Reply-To: <200504061314.27740.vda@port.imtp.ilyichevsk.odessa.ua>
[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]
Am Mittwoch, den 06.04.2005, 13:14 +0300 schrieb Denis Vlasenko:
> Oh shit. I was trying to be too clever. I still run with this patch,
> so it must be happening very rarely.
Yes, that's right, it happened with code that's not in the mainline tree
but could have happened anywhere.
> Does this one compile ok?
Yes, the case that failed is now okay. I changed it slightly to assign
esi and edi directy on top of the functions, no asm section needed here.
The compiler will make sure that they have the correct values when
needed.
In the case above the compiler now uses %ebx to save the loop counter
instead of %esi.
In drivers/cdrom/cdrom.c I'm observing one very strange thing though.
It appears that the compiler decided to put the local variable edi on
the stack for some unexplicable reason (or possibly there is?). Since
the asm sections are memory barriers the compiler then saves the value
of %edi on the stack before entering the next assembler section.
1f1c: a5 movsl %ds:(%esi),%es:(%edi)
1f1d: 89 7d 84 mov %edi,0xffffff84(%ebp)
1f20: a5 movsl %ds:(%esi),%es:(%edi)
1f21: 89 7d 84 mov %edi,0xffffff84(%ebp)
1f24: 66 a5 movsw %ds:(%esi),%es:(%edi)
(this is a constant 10 byte memcpy)
The only thing that would avoid this is to either tell the compiler to
never put esi/edi in memory (which I think is not possibly across
different versions of gcc) or to always generate a single asm section
for all the different cases.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-04-06 12:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-29 14:37 memcpy(a,b,CONST) is not inlined by gcc 3.4.1 in Linux kernel Denis Vlasenko
2005-03-29 15:06 ` Richard Guenther
2005-03-29 15:08 ` Nathan Sidwell
2005-03-29 15:13 ` Jakub Jelinek
2005-03-29 15:42 ` Andrew Pinski
2005-03-30 2:27 ` Gerold Jury
2005-03-30 6:15 ` Denis Vlasenko
2005-04-01 21:43 ` Jan Hubicka
2005-04-02 12:18 ` Denis Vlasenko
2005-04-02 12:26 ` Denis Vlasenko
2005-04-05 16:34 ` [BUG mm] "fixed" i386 memcpy inlining buggy Christophe Saout
2005-04-06 10:14 ` Denis Vlasenko
2005-04-06 11:05 ` Dave Korn
2005-04-06 11:13 ` Dave Korn
2005-04-06 11:53 ` Dave Korn
2005-04-06 11:56 ` Dave Korn
2005-04-06 13:18 ` Richard B. Johnson
2005-04-06 14:16 ` Denis Vlasenko
2005-04-06 12:05 ` Christophe Saout [this message]
2005-04-06 12:36 ` Andrew Haley
2005-04-06 15:18 ` Paolo Bonzini
2005-04-06 16:11 ` Denis Vlasenko
2005-03-29 20:22 ` [PATCH] fix i386 memcpy Denis Vlasenko
2005-03-29 20:24 ` Denis Vlasenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1112789157.32279.13.camel@leto.cs.pocnet.net \
--to=christophe@saout.de \
--cc=akpm@osdl.org \
--cc=gcc@gcc.gnu.org \
--cc=gerold.ml@inode.at \
--cc=hubicka@ucw.cz \
--cc=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®