This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc compile time support for assumptions


On 18 Jan 2007 07:51:51 -0800, Ian Lance Taylor <iant@google.com> wrote:
Andrew Haley <aph@redhat.com> writes:

> Ian Lance Taylor writes:
>  > Abramo Bagnara <abramobagnara@tin.it> 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.
>
> Something like this would greatly improve the code generation quality
> of gcj.  There are a great many assertions that I could pass to VRP
> and the optimizers: this is invariant, this is less than that, and so
> on.

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.

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. Of course if the asserts still end up in the source VRP already can derive information from the IL of the assert code.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]