[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: GCC optimizes integer overflow: bug or feature?
From: |
Dave Korn |
Subject: |
RE: GCC optimizes integer overflow: bug or feature? |
Date: |
Wed, 20 Dec 2006 02:33:52 -0000 |
On 20 December 2006 02:28, Andrew Pinski wrote:
>> Paul Brook wrote:
>>>> Compiler can optimize it any way it wants,
>>>> as long as result is the same as unoptimized one.
>>>
>>> We have an option for that. It's called -O0.
>>>
>>> Pretty much all optimization will change the behavior of your program.
>>
>> Now that's a bit TOO strong a statement, critical optimizations like
>> register allocation and instruction scheduling will generally not change
>> the behavior of the program (though the basic decision to put something
>> in a register will, and *surely* no one suggests avoiding this critical
>> optimization).
>
> Actually they will with multi threaded program, since you can have a case
> where it works and now it is broken because one thread has speed up so much
> it writes to a variable which had a copy on another thread's stack.
Why isn't that just a buggy program with wilful disregard for the use of
correct synchronisation techniques?
cheers,
DaveK
--
Can't think of a witty .sigline today....
- Re: GCC optimizes integer overflow: bug or feature?, (continued)
- Re: GCC optimizes integer overflow: bug or feature?, Denis Vlasenko, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Andrew Haley, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Denis Vlasenko, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Paul Brook, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Andrew Pinski, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- RE: GCC optimizes integer overflow: bug or feature?,
Dave Korn <=
- Re: GCC optimizes integer overflow: bug or feature?, Robert Dewar, 2006/12/19
- Re: GCC optimizes integer overflow: bug or feature?, Mike Stump, 2006/12/20
- RE: GCC optimizes integer overflow: bug or feature?, Dave Korn, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Matthew Woehlke, 2006/12/20
- RE: GCC optimizes integer overflow: bug or feature?, Dave Korn, 2006/12/20
- Message not available
- Re: GCC optimizes integer overflow: bug or feature?, Andreas Schwab, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Matthew Woehlke, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Seongbae Park, 2006/12/20
- RE: GCC optimizes integer overflow: bug or feature?, Dave Korn, 2006/12/20
- Re: GCC optimizes integer overflow: bug or feature?, Gabriel Dos Reis, 2006/12/20