Re: Is gcc thread-unsafe?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Thursday, October 25, 2007 - 12:15 am

On Thursday 25 October 2007 05:24, Nick Piggin wrote:


This case is clearly a bug, a very likely code pessimization.
I guess it wasn't intentional, just an optimization that is useful
for local register values doing too much.


Often accesses happen without function calls inbetween.
Also I think newer gcc (not 3.x) can determine if a pointer
"escapes" or not so that might not protect against it.


We don't have much choice: If such a case is found it has to be marked
volatile or that particular compiler version be unsupported.

It might be useful to come up with some kind of assembler pattern
matcher to check if any such code is generated for the kernel
and try it with different compiler versions.

-Andi
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Is gcc thread-unsafe?, Nick Piggin, (Wed Oct 24, 8:24 pm)
Re: Is gcc thread-unsafe?, Arjan van de Ven, (Wed Oct 24, 8:46 pm)
Re: Is gcc thread-unsafe?, Nick Piggin, (Wed Oct 24, 8:58 pm)
RE: Is gcc thread-unsafe?, David Schwartz, (Wed Oct 24, 9:29 pm)
Re: Is gcc thread-unsafe?, Arjan van de Ven, (Wed Oct 24, 9:35 pm)
Re: Is gcc thread-unsafe?, Nick Piggin, (Wed Oct 24, 9:47 pm)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 12:15 am)
Re: Is gcc thread-unsafe?, Samuel Tardieu, (Thu Oct 25, 2:44 am)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 2:55 am)
Re: Is gcc thread-unsafe?, linux-os (Dick Johnson), (Thu Oct 25, 4:58 am)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 5:16 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Thu Oct 25, 7:55 am)
Re: Is gcc thread-unsafe?, Pekka Enberg, (Thu Oct 25, 8:12 am)
RE: Is gcc thread-unsafe?, David Schwartz, (Thu Oct 25, 2:42 pm)
Re: Is gcc thread-unsafe?, Ismail , (Thu Oct 25, 3:26 pm)
Re: Is gcc thread-unsafe?, Nick Piggin, (Thu Oct 25, 3:49 pm)
Re: Is gcc thread-unsafe?, Jeff Garzik, (Thu Oct 25, 3:56 pm)
Re: Is gcc thread-unsafe?, Jeff Garzik, (Thu Oct 25, 4:04 pm)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 4:09 pm)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Thu Oct 25, 4:14 pm)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 4:16 pm)
Re: Is gcc thread-unsafe?, Nick Piggin, (Thu Oct 25, 4:22 pm)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Thu Oct 25, 4:32 pm)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 4:42 pm)
Re: Is gcc thread-unsafe?, Nick Piggin, (Thu Oct 25, 4:43 pm)
Re: Is gcc thread-unsafe?, Andi Kleen, (Thu Oct 25, 4:55 pm)
Re: Is gcc thread-unsafe?, Nick Piggin, (Thu Oct 25, 4:57 pm)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Thu Oct 25, 4:57 pm)
Re: Is gcc thread-unsafe?, Zachary Amsden, (Thu Oct 25, 6:15 pm)
Re: Is gcc thread-unsafe?, Willy Tarreau, (Thu Oct 25, 9:57 pm)
Re: Is gcc thread-unsafe?, Andrew Haley, (Fri Oct 26, 4:59 am)
Re: Is gcc thread-unsafe?, Andrew Haley, (Fri Oct 26, 4:59 am)
Re: Is gcc thread-unsafe?, Chris Friesen, (Fri Oct 26, 10:39 am)
Re: Is gcc thread-unsafe?, Phillip Susi, (Wed Oct 31, 3:10 pm)