bug-gnulib
[Top][All Lists]
Advanced

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

Re: GCC optimizes integer overflow: bug or feature?


From: Gabriel Dos Reis
Subject: Re: GCC optimizes integer overflow: bug or feature?
Date: 21 Dec 2006 03:44:43 +0100

"Dave Korn" <address@hidden> writes:

[...]

| > We (in a major, commercial application) ran into exactly this issue.
| > 'asm volatile("lock orl $0,(%%esp)"::)' is your friend when this happens
| > (it is a barrier across which neither the compiler nor CPU will reorder
| > things). Failing that, no-op cross-library calls (that can't be inlined)
| > seem to do the trick.
| 
|   This simply means you have failed to correctly declare a variable volatile
| that in fact /is/ likely to be spontaneously changed by a separate thread of
| execution.

Note however, that declaring the variable "volatile" is no guarantee
that things will actually work as "expected.  We have had that
discussion before :-)

-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]