[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: |
Joe Buck |
Subject: |
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..." |
Date: |
Sat, 30 Dec 2006 17:34:01 -0800 |
User-agent: |
Mutt/1.4.1i |
On Sat, Dec 30, 2006 at 04:13:08PM -0800, Paul Eggert wrote:
> I am. I just now looked and found another example.
> gcc-4.3-20061223/gcc/fold-const.c's neg_double function
> contains this line:
>
> *hv = - h1;
>
> This one is a bit less obvious because it doesn't have a
> "Danger Will Robinson!" comment next to it, but h1 is a
> signed integer and it's easy to arrange for h1 to have its
> minimal value, so that "- h1" overflows.
This code would blow up if an integer overflow caused a trap.
I wonder if -ftrapv could be used to catch these kinds of
problems?
I suppose there is
*hv = (HOST_WIDE_INT) -(unsigned HOST_WIDE_INT) h1;
to make it safe.
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", (continued)
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Bruce Korb, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Robert Dewar, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Paul Eggert, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Ian Lance Taylor, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Daniel Berlin, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Bruce Korb, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Bernd Schmidt, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Gabriel Dos Reis, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...",
Joe Buck <=
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2006/12/30
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Joe Buck, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Paul Eggert, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Vincent Lefevre, 2006/12/31
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Eric Blake, 2006/12/30
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2006/12/30
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Gabriel Dos Reis, 2006/12/30
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Guenther, 2006/12/30
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Gabriel Dos Reis, 2006/12/30