On Wed, 3 Oct 2007, Linus Torvalds wrote:Btw, this definitely doesn't happen for me, either on x86-64 or plain x86. The x86 thing I tested was Fedora 8 testing (ie not even some stable setup), so I wonder what experimental compiler you have. Your compiler generates movl -16(%ebp),%edx movl (%edx),%edi /* this is _totally_ bogus! */ incl %edx movl %edx,-16(%ebp) movl %edi,%ecx testb %cl,%cl je ... while I get (gcc version 4.1.2 20070925 (Red Hat 4.1.2-28)): movl -16(%ebp), %eax # p, movzbl (%eax), %edi #, c /* not bogus! */ movl %edi, %edx # c, testb %dl, %dl # je .L64 #, incl %eax # movsbl %dl,%ebx #, D.12414 movl %eax, -16(%ebp) #, p where the difference (apart from doing the increment differently and different register allocation) is that I have a "movzbl" (correct), while you have a "movl" (pure and utter crap). I *suspect* that the compiler bug is along the lines of: (a) start off with movzbl (b) notice that the higher bits don't matter, because nobody subsequently uses them (c) turn the thing into just a byte move. (d) make the totally incorrect optimization of using a full 32-bit move in order to avoid a partial register access stall and the thing is, that final optimization can actually speed things up (although it can also slow things down for any access that crosses a cache sector boundary - 8/16 bytes), but it's seriously bogus, exactly because it can cause an invalid access to the three next bytes that may not even exist. Linus -
| Artem Bityutskiy | [PATCH 10/44 take 2] [UBI] debug unit implementation |
| Jeremy Fitzhardinge | [PATCH 03 of 36] x86: add memory barriers to wrmsr |
| Zachary Amsden | Re: [patch 13/26] Xen-paravirt_ops: Consistently wrap paravirt ops callsites to ma... |
| Justin Mattock | macbook pro dvd playback after suspend Buffer I/O error |
git: | |
| David Kastrup | Empty directories... |
| Johannes Schindelin | Re: [PATCH 1/4] Move redo merge code in a function |
| Jeff King | Re: detecting rename->commit->modify->commit |
| Pierre Habouzit | Re: [RFC] git integrated bugtracking |
| David Higgs | Re: Using the C programming language |
| Chris Bullock | OpenBSD isakmpd and pf vs Cisco PIX or ASA |
| Richard Stallman | Real men don't attack straw men |
| Chris S | Re: No text cursor on OpenBSD/i386 4.1 |
| Jojie R. T. | Re: SLS |
| Peter MacDonald | demand paging: proposal |
| Theodore Ts'o | Re: Stabilizing Linux |
| Doug Evans | Re: Stabilizing Linux |
| Battery Maximizer Software | 8 hours ago | Linux kernel |
| windows folder creation surprise | 9 hours ago | Windows |
| Problem in scim in Fedora 9 | 11 hours ago | Linux general |
| Firewall | 1 day ago | OpenBSD |
| IP layer send packet | 1 day ago | Linux kernel |
| dtrace for linux available | 2 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 2 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 2 days ago | NetBSD |
| vsftpd Upload Problems | 2 days ago | Linux general |
| creating con folder in desktop | 3 days ago | Windows |
