Re: Optimization techniques

Kaz Kylheku <847-115-0292@kylheku.com>
Fri, 26 Apr 2019 21:11:09 +0000 (UTC)

          From comp.compilers

Related articles
[19 earlier articles]
Re: Optimization techniques 847-115-0292@kylheku.com (Kaz Kylheku) (2019-04-26)
Re: Optimization techniques 847-115-0292@kylheku.com (Kaz Kylheku) (2019-04-26)
Re: Optimization techniques alexfrunews@gmail.com (2019-04-26)
Re: Optimization techniques derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2019-04-26)
Re: Optimization techniques martin@gkc.org.uk (Martin Ward) (2019-04-26)
Re: Optimization techniques martin@gkc.org.uk (Martin Ward) (2019-04-26)
Re: Optimization techniques 847-115-0292@kylheku.com (Kaz Kylheku) (2019-04-26)
Re: Optimization techniques 0xe2.0x9a.0x9b@gmail.com (2019-04-27)
Re: Optimization techniques haberg-news@telia.com (Hans Aberg) (2019-04-27)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-28)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-28)
Re: Optimization techniques genew@telus.net (Gene Wirchenko) (2019-04-30)
Re: Optimization techniques genew@telus.net (Gene Wirchenko) (2019-04-30)
[9 later articles]
| List of all articles for this month |

From: Kaz Kylheku <847-115-0292@kylheku.com>
Newsgroups: comp.compilers
Date: Fri, 26 Apr 2019 21:11:09 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 19-04-004 19-04-012 19-04-018 19-04-028
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="87687"; mail-complaints-to="abuse@iecc.com"
Keywords: arithmetic
Posted-Date: 27 Apr 2019 10:16:10 EDT

On 2019-04-26, Martin Ward <martin@gkc.org.uk> wrote:
> On 23/04/19 08:43, David Brown wrote:
>> But mathematical identities such as associativity and commutativity are
>> valid because signed integer overflow does not happen - thus "a * (b +
>> c)" can be changed to "(a * b) + (a * c)".
>
> If b is large and c has a value close to -b then a * (b + c)
> might be OK while (a * b) will overflow and cause undefined
> behaviour.


I.e. careless application of arithmetic identities can introduce
overflows that don't exist in the original form.


--
TXR Programming Lanuage: http://nongnu.org/txr
Music DIY Mailing List: http://www.kylheku.com/diy
ADA MP-1 Mailing List: http://www.kylheku.com/mp1


Post a followup to this message

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