This is the mail archive of the gcc-bugs@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]

[Bug middle-end/68046] -ftrapv doesn't catch leaq-based overflows on x86-64


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68046

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
If we have a variant that doesn't require libubsan (which is not available
on all targets) then yes, that would indeed be nice.  Of course it's restricted
to the C family languages while -ftrapv was "working" for all languages before
(though IIRC Ada has its own implementation).

Note this bug may be a duplicate (and I must admit I didn't end up committing
a few fixes I had for some of the -ftrapv bugs...).  The testcase works in
my dev tree:

main:
.LFB0:
        .cfi_startproc
        pushq   %rbx
        .cfi_def_cfa_offset 16
        .cfi_offset 3, -16
        movq    i(%rip), %rbx
        movl    $1, %esi
        movq    %rbx, %rdi
        call    __addvdi3
        cmpq    %rax, %rbx
        setg    %al
        movzbl  %al, %eax
        popq    %rbx
        .cfi_def_cfa_offset 8
        ret

> ./a.out
Aborted

Sorry about that... :/  (see PR61893)

I'm going to re-test and commit the optab changes (which I believe triggers
the above issue).

*** This bug has been marked as a duplicate of bug 61893 ***


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