[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Optimize assume(...) away? (agaiin)
From: |
Dmitry Antipov |
Subject: |
Optimize assume(...) away? (agaiin) |
Date: |
Wed, 09 Oct 2013 20:43:17 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
1) http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00238.html
2) http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15565
3) Consider non-trivial eassert like:
eassert ((BUFFERP (it->object)
&& IT_CHARPOS (*it) == it->bidi_it.charpos
&& IT_BYTEPOS (*it) == it->bidi_it.bytepos)
|| (STRINGP (it->object)
&& IT_STRING_CHARPOS (*it) == it->bidi_it.charpos
&& IT_STRING_BYTEPOS (*it) == it->bidi_it.bytepos)
|| (CONSP (it->object) && it->method == GET_FROM_STRETCH))
a) It takes some time to check whether there are side effects here;
b) If someone change 'struct it' so IT_STRING_CHARPOS (*it)
becomes a non-trivial function with side effects, it would be
too annoying (and error-prone) to review all easserts.
Due to 1), 2) and 3) I strongly suggests to redesign eassert
to avoid any assumptions about its argument expression.
Dmitry
- Optimize assume(...) away? (agaiin),
Dmitry Antipov <=