Re: gcc compile time support for assumptions

2007-01-25 Thread Diego Novillo
Ian Lance Taylor wrote on 01/18/07 10:51: Well, internally, we do have ASSERT_EXPR. It would probably take a little work to permit the frontends to generate it, but the optimizers should understand it. By default, they do not. When I initially implemented VRP, I was adding ASSERT_EXPRs right

Re: gcc compile time support for assumptions

2007-01-18 Thread Richard Guenther
On 18 Jan 2007 10:19:37 -0600, Gabriel Dos Reis <[EMAIL PROTECTED]> wrote: Paolo Carlini <[EMAIL PROTECTED]> writes: | Richard Guenther wrote: | | > Providing a __builtin_assert () function is still one thing on my | > TODO, we can | > derive proper ASSERT_EXPRs from it in VRP even in the -DNDEB

Re: gcc compile time support for assumptions

2007-01-18 Thread Gabriel Dos Reis
Paolo Carlini <[EMAIL PROTECTED]> writes: | Richard Guenther wrote: | | > Providing a __builtin_assert () function is still one thing on my | > TODO, we can | > derive proper ASSERT_EXPRs from it in VRP even in the -DNDEBUG case. | | Great! Certainly could be profitably used in libstdc++. Indee

Re: gcc compile time support for assumptions

2007-01-18 Thread Richard Guenther
On 1/18/07, Robert Dewar <[EMAIL PROTECTED]> wrote: Andrew Haley wrote: > Ian Lance Taylor writes: > > Abramo Bagnara <[EMAIL PROTECTED]> writes: > > > > > I'd like to know if gcc has implemented some generic way to help > > > optimizer job by allowing programmers to specify assumptions (or >

Re: gcc compile time support for assumptions

2007-01-18 Thread Robert Dewar
Andrew Haley wrote: Ian Lance Taylor writes: > Abramo Bagnara <[EMAIL PROTECTED]> writes: > > > I'd like to know if gcc has implemented some generic way to help > > optimizer job by allowing programmers to specify assumptions (or > > constraints). > > The answer is no, there is nothing

Re: gcc compile time support for assumptions

2007-01-18 Thread Paolo Carlini
Richard Guenther wrote: Providing a __builtin_assert () function is still one thing on my TODO, we can derive proper ASSERT_EXPRs from it in VRP even in the -DNDEBUG case. Great! Certainly could be profitably used in libstdc++. Paolo.

Re: gcc compile time support for assumptions

2007-01-18 Thread Richard Guenther
On 18 Jan 2007 07:51:51 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: Andrew Haley <[EMAIL PROTECTED]> writes: > Ian Lance Taylor writes: > > Abramo Bagnara <[EMAIL PROTECTED]> writes: > > > > > I'd like to know if gcc has implemented some generic way to help > > > optimizer job by allo

Re: gcc compile time support for assumptions

2007-01-18 Thread Ian Lance Taylor
Andrew Haley <[EMAIL PROTECTED]> writes: > Ian Lance Taylor writes: > > Abramo Bagnara <[EMAIL PROTECTED]> writes: > > > > > I'd like to know if gcc has implemented some generic way to help > > > optimizer job by allowing programmers to specify assumptions (or > > > constraints). > > > >

Re: gcc compile time support for assumptions

2007-01-18 Thread Andrew Haley
Ian Lance Taylor writes: > Abramo Bagnara <[EMAIL PROTECTED]> writes: > > > I'd like to know if gcc has implemented some generic way to help > > optimizer job by allowing programmers to specify assumptions (or > > constraints). > > The answer is no, there is nothing quite like you describe

Re: gcc compile time support for assumptions

2007-01-18 Thread Ian Lance Taylor
Abramo Bagnara <[EMAIL PROTECTED]> writes: > I'd like to know if gcc has implemented some generic way to help > optimizer job by allowing programmers to specify assumptions (or > constraints). The answer is no, there is nothing quite like you describe. But I think it would be a good idea. Ian

gcc compile time support for assumptions

2007-01-18 Thread Abramo Bagnara
I'd like to know if gcc has implemented some generic way to help optimizer job by allowing programmers to specify assumptions (or constraints). This is somewhat different from assertions: suppose we have this simple code: #include int p(int a) { assert(a > 0); return a <= 0; } Compiling w