Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: George Neuner Newsgroups: comp.compilers Subject: Re: Optimization techniques Date: Sat, 20 Apr 2019 18:59:45 -0400 Organization: A noiseless patient Spider Lines: 21 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-04-015@comp.compilers> References: <19-04-004@comp.compilers> <19-04-012@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="28068"; mail-complaints-to="abuse@iecc.com" Keywords: C, optimize Posted-Date: 20 Apr 2019 22:36:09 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2199 On Sat, 20 Apr 2019 00:27:11 +0200, Hans-Peter Diettrich wrote: >I'm always a bit sceptic when C/C++ and "safe" occur in the same >sentence. AFAIR a C compiler is allowed to ignore parentheses when >reordering expressions, what can lead to numeric instabilities. By the standard, a C compiler IS required to respect parentheses within an arithmetic expression. But even fully parenthesized expressions contain subexpressions whose evaluations can be reordered. e.g., (a + (b + c)) has to be equivalent to t1 = b + c t2 = a + t1 but if any of a, b, or c is an expression itself - e.g., a pointer dereference - the parenthesized expression does not imply any ordering of *their* individual evaluations. George