emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r114593: * lisp.h (eassert): Don't use 'assume'.


From: Dmitry Antipov
Subject: Re: [Emacs-diffs] trunk r114593: * lisp.h (eassert): Don't use 'assume'.
Date: Fri, 11 Oct 2013 14:31:07 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 10/11/2013 01:55 PM, Daniel Colascione wrote:

You could argue that having two macros instead of one imposes a maintenance 
burden
and that there isn't a payoff sufficient to justify this burden, but I don't 
think
the maintenance cost of having another macro is very large, especially if we 
leave
existing assertions as they are and use the assume-and-assert macro only for 
cases
that are clearly free of side effects.

May be I missed something, but could you please provide an example where
assume (...) really yields in better code?  As for the signed vs. (more
efficient) unsigned arithmetic, you can't turn:

int f (int x, int y, int z)
{
  return x / y + y / z + z / x;
}

into:

unsigned f (unsigned x, unsigned y, unsigned z)
{
  return x / y + y / z + z / x;
}

using assume(...), e.g.

int f (int x, int y, int z)
{
  assume (x >= 0);
  assume (y >= 0);
  assume (z >= 0);
  return x / y + y / z + z / x;
}

is just the same as in the first case.

Dmitry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]