]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use a "sided" comparison rather than a "point" comparison, so as to
authorJulian Seward <jseward@acm.org>
Sat, 8 Nov 2008 15:14:01 +0000 (15:14 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 8 Nov 2008 15:14:01 +0000 (15:14 +0000)
ensure that gcc generates only one conditional jump per conditional
expression, not two.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8743

memcheck/tests/fprw.c

index f60038e895c4ad47677d30047a4e10be56809264..6eb304d2ff5e981e3616b85fb299729139a9419f 100644 (file)
@@ -13,8 +13,8 @@ int main ( void )
    int* ip = (int*)0x1234567;
    d += 1.0;
    f += 10.0;
-   *dp += ( d ? 2.0 : 3.0 );
-   *fp += ( f ? 20.0 : 21.0 );
+   *dp += ( d > 0.1  ? 2.0 : 3.0 );
+   *fp += ( f > 0.1  ? 20.0 : 21.0 );
    free(dp);
    free(fp);
    *dp += 3.0;