bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] Re: changing "configure" to default to "gcc -g -O2 -fwr


From: Bruno Haible
Subject: Re: [bug-gnulib] Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Mon, 8 Jan 2007 18:14:19 +0100
User-agent: KMail/1.9.1

Richard Kenner wrote:
> (3) How many programs are known to rely on wrap semantics?  For each:
>   (a) How hard was it to determine there was a problem with that
>       assumption?

A piece of data for GNU clisp and cln:

  - For clisp, it was easy to find out and fix all problems, because the
    package has a good testsuite coverage. It was just a matter of building
    the package with CFLAGS=-ftrapv, doing "make check", and debugging the
    abort() calls. 2 or 3 hours of work.
    Just 2 problems were found:
      - A loop:
           for (x=1; x != 0; x = x+x) ...
        This is the same idiom as Paul's example.
      - A bitmask computation that assumed two's complement arithmetic:
           if (n > 0)
             *p &= (unsigned int) ((1 << (32 - n)) - 1);

  - For cln, I fixed the easily spottable problems, but I completely ignore
    how many other problems remain - because the package has only a small
    testsuite, and gcc last week emitted no warnings when it exploits the C99
    semantics of signed integer overflow.

Bruno




reply via email to

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