Re: Subtraction + comparison in one asm instruction?

"Gabriel Dos Reis" <gdr@integrable-solutions.net>
12 Sep 2002 01:41:32 -0400

          From comp.compilers

Related articles
[3 earlier articles]
Re: Subtraction + comparison in one asm instruction? walter@bytecraft.com (Walter Banks) (2002-08-23)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-08-23)
Re: Subtraction + comparison in one asm instruction? gdr@soliton.integrable-solutions.net (Gabriel Dos Reis) (2002-09-03)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-09-08)
Re: Subtraction + comparison in one asm instruction? gdr@integrable-solutions.net (Gabriel Dos Reis) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? vbdis@aol.com (VBDis) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? gdr@integrable-solutions.net (Gabriel Dos Reis) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? anton@mips.complang.tuwien.ac.at (Anton Ertl) (2002-09-14)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-09-14)
Re: Subtraction + comparison in one asm instruction? vbdis@aol.com (VBDis) (2002-09-19)
Re: Subtraction + comparison in one asm instruction? anton@mips.complang.tuwien.ac.at (Anton Ertl) (2002-09-19)
Re: Subtraction + comparison in one asm instruction? joachim_d@gmx.de (Joachim Durchholz) (2002-09-19)
[3 later articles]
| List of all articles for this month |

From: "Gabriel Dos Reis" <gdr@integrable-solutions.net>
Newsgroups: comp.compilers
Date: 12 Sep 2002 01:41:32 -0400
Organization: Linux Private Site
References: 02-09-038 02-09-076
Keywords: arithmetic
Posted-Date: 12 Sep 2002 01:41:32 EDT

"VBDis" <vbdis@aol.com> writes:


> The conversion of formulas,
> according to algebraic rules, IMO is independent from the ranges of
> the data types which are used in actual source code.


No, that is not true in C, nor in C++ for example.


On a machine set up to trap when an overflow occurs, the behaviour for
the strict semantics of "(x + 1) - 1" is to trap when
x == INT_MAX for example, while the transformed version will not trap:
The net result is that the semantics of the transformed expression no
longr match that of the untouched one.


Now, the C or C++ language definition says that overflows trigger
undefined behaviour. So a compiler could use that excuse to do
whatever transformation that meets its understanding of
optimization. Another compiler may not touch the expression and hands
off the situation to whatever handlers may be installed by the user.
It is just a quality of implementation issue.


-- Gaby


Post a followup to this message

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