all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Optimize assume(...) away?
@ 2013-10-08 12:46 Dmitry Antipov
  0 siblings, 0 replies; only message in thread
From: Dmitry Antipov @ 2013-10-08 12:46 UTC (permalink / raw)
  To: Emacs development discussions; +Cc: Paul Eggert

Did someone _really_ check that assume(...) is always optimized away when
ENABLE_CHECKING is not defined? I'm looking at set_iterator_to_next and see:

xdisp.c:
...
	  eassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
...

xdisp.i:
...
   ((((*it).current.pos).bytepos == (buf_charpos_to_bytepos (current_buffer, ((*it).current.pos).charpos))) ? (void) 0 : __builtin_unreachable ());
...

xdisp.s (-fverbose-asm):
...
.L4055:
	.loc 1 7186 0
	testb	$16, 2466(%rbx)	#, *it_23(D)
	.loc 1 7184 0
	movslq	2144(%rbx), %rax	# it_23(D)->len,
	.loc 1 7186 0
	jne	.L4072	#,
	.loc 1 7188 0
	addq	%rax, 336(%rbx)	# D.129872, it_23(D)->current.pos.bytepos
	.loc 1 7189 0
	movq	328(%rbx), %rax	# it_23(D)->current.pos.charpos, tmp348
	leaq	1(%rax), %rsi	#, D.129872
.LVL4320:
	movq	%rsi, 328(%rbx)	# D.129872, it_23(D)->current.pos.charpos
.L4073:
	.loc 1 7212 0
	movq	current_buffer(%rip), %rdi	# current_buffer,
	call	buf_charpos_to_bytepos	#                                      ;; OOPS

Stock Fedora19 gcc 4.8.1, -O2 -g3 -fverbose-asm.

Dmitry



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-08 12:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 12:46 Optimize assume(...) away? Dmitry Antipov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.