emacs-devel
[Top][All Lists]
Advanced

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

Optimize assume(...) away?


From: Dmitry Antipov
Subject: Optimize assume(...) away?
Date: Tue, 08 Oct 2013 16:46:20 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

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



reply via email to

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