Re: Optimization techniques

George Neuner <gneuner2@comcast.net>
Sat, 20 Apr 2019 18:59:45 -0400

          From comp.compilers

Related articles
[5 earlier articles]
Re: Optimization techniques 847-115-0292@kylheku.com (Kaz Kylheku) (2019-04-19)
Re: Optimization techniques rick.c.hodgin@gmail.com (Rick C. Hodgin) (2019-04-19)
Re: Optimization techniques gneuner2@comcast.net (George Neuner) (2019-04-19)
Re: Optimization techniques DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2019-04-20)
Re: Optimization techniques rick.c.hodgin@gmail.com (Rick C. Hodgin) (2019-04-19)
Re: Optimization techniques DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2019-04-20)
Re: Optimization techniques gneuner2@comcast.net (George Neuner) (2019-04-20)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-23)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-23)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-23)
Re: Optimization techniques rick.c.hodgin@gmail.com (Rick C. Hodgin) (2019-04-24)
Re: Optimization techniques martin@gkc.org.uk (Martin Ward) (2019-04-25)
Re: Optimization techniques david.brown@hesbynett.no (David Brown) (2019-04-25)
[23 later articles]
| List of all articles for this month |
From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Sat, 20 Apr 2019 18:59:45 -0400
Organization: A noiseless patient Spider
References: 19-04-004 19-04-012
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

On Sat, 20 Apr 2019 00:27:11 +0200, Hans-Peter Diettrich
<DrDiettrich1@netscape.net> 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


Post a followup to this message

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