[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."

From: Richard Kenner
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Sat, 30 Dec 2006 20:50:11 EST

> if (a - 10 < 20)
> Well that particular example is far fetched in code that people
> expect to run efficiently, but with a bit of effort you could
> come up with a more realistic example.

Not at all far-fetched.  The normal way these things come up is macros:

#define DIGIT_TO_INT(D) (D - '0')
        if (DIGIT_TO_INT (a) < 5)

> Compilers are always full of such optimizations which are simple to do
> and get put in without any sound basis for determining that they actually
> help. 

Given the pervasiveness of macros of this type, this sort of folding
optimization catches a lot of cases.  And the answer to where a lot of
wierd-looking code comes from is also macros.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]