[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: |
Ian Lance Taylor |
Subject: |
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..." |
Date: |
01 Jan 2007 18:14:19 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
address@hidden (Richard Kenner) writes:
> The question that I'd like to understand the answer to is what kinds of
> optimizations DO we get by having VRP optimized signed overflow. Is it just
> the elimination of tests on overflow? If so, then it strikes me as
> definitely wrong since those tests are probably there precisely to test for
> overflow.
VRP as currently written adjust limits out to "infinity" of an
appropriate sign for variables which are changed in loops. It then
assumes that the (signed) variable will not wrap past that point,
since that would constitute undefined signed overflow.
For example:
extern void bar (void);
void
foo (int m)
{
int i;
for (i = 1; i < m; ++i)
{
if (i > 0)
bar ();
}
}
Here the limit for i without -fwrapv becomes (1, INF]. This enables
VRP to eliminate the test "i > 0". With -fwrapv, this test of course
can not be eliminated. VRP is the only optimization pass which is
able to eliminate that test.
Ian
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", (continued)
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Joe Buck, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Sandiford, 2007/01/04
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Guenther, 2007/01/04
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Sandiford, 2007/01/04
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Guenther, 2007/01/04
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Guenther, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Mark Mitchell, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2007/01/01
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Mark Mitchell, 2007/01/01
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...",
Ian Lance Taylor <=
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2007/01/01
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Andrew Pinski, 2007/01/01
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Gabriel Dos Reis, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Gerald Pfeifer, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Gabriel Dos Reis, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Richard Kenner, 2007/01/02
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Geert Bosch, 2007/01/02
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Diego Novillo, 2007/01/02
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Laurent GUERBY, 2007/01/03