Re: Optimization techniques and undefined behavior

David Brown <david.brown@hesbynett.no>
Tue, 7 May 2019 16:05:49 +0200

          From comp.compilers

Related articles
[28 earlier articles]
Re: Optimization techniques and undefined behavior gneuner2@comcast.net (George Neuner) (2019-05-04)
Re: Optimization techniques and undefined behavior david.brown@hesbynett.no (David Brown) (2019-05-06)
Re: Optimization techniques and undefined behavior martin@gkc.org.uk (Martin Ward) (2019-05-06)
Re: Optimization techniques and undefined behavior robin51@dodo.com.au (Robin Vowels) (2019-05-07)
Re: Optimization techniques and undefined behavior derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2019-05-06)
Re: Optimization techniques and undefined behavior david.brown@hesbynett.no (David Brown) (2019-05-07)
Re: Optimization techniques and undefined behavior david.brown@hesbynett.no (David Brown) (2019-05-07)
Re: Optimization techniques and undefined behavior david.brown@hesbynett.no (David Brown) (2019-05-07)
Re: Optimization techniques and undefined behavior david.brown@hesbynett.no (David Brown) (2019-05-07)
Re: Optimization techniques and undefined behavior martin@gkc.org.uk (Martin Ward) (2019-05-08)
Re: Optimization techniques and undefined behavior gneuner2@comcast.net (George Neuner) (2019-05-08)
Re: Optimization techniques and undefined behavior genew@telus.net (Gene Wirchenko) (2019-05-11)
| List of all articles for this month |
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.compilers
Date: Tue, 7 May 2019 16:05:49 +0200
Organization: A noiseless patient Spider
References: 19-05-014 19-04-021 19-04-023 19-04-037 19-04-039 19-04-042 19-04-044 19-04-047 19-05-004 19-05-008 19-05-014 19-05-021 19-05-041
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="25228"; mail-complaints-to="abuse@iecc.com"
Keywords: arithmetic, errors, comment
Posted-Date: 07 May 2019 18:43:42 EDT
In-Reply-To: 19-05-041
Content-Language: en-GB

On 06/05/2019 17:22, Robin Vowels wrote:
> From: "David Brown" <david.brown@hesbynett.no>
> Sent: Saturday, May 04, 2019 1:23 AM
>
>> You are, as usual, very keen to pick out gcc as though it was something
>> special here.  Compilers have been assuming signed integer overflow
>> never happens for over 20 years (that's just from my own personal
>> experience), long before gcc was that smart.
>
> Some compilers might, but I have not met one that does ignore
> overflow.
>


I have met several (other than gcc). These were not PC/x86 compilers.


> Even in evaluating compile-time expressions, an overflow
> is treated as an error, and a diagnostic is issued.


That is usually the case, and is helpful.


> [clang and gcc definitely generate code that ignores integer overflows
> at runtime. I just checked. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.