[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: |
Geert Bosch |
Subject: |
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..." |
Date: |
Tue, 2 Jan 2007 14:59:24 -0500 |
On Jan 1, 2007, at 21:14, Ian Lance Taylor wrote:
[...]
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.
We should be able to optimize this even for -fwrapv.
For i = 0, the loop will not execute at all, for other
i, execution will stop when i == m, after m - 1 executions
of the loop body. The condition i > 0 will never be true,
regardless of -fwrapv as there won't be overflow.
-Grt
- Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", (continued)
- 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, 2007/01/01
- 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 <=
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
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ...", Thorsten Glaser, 2007/01/16