This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/68046] -ftrapv doesn't catch leaq-based overflows on x86-64
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Oct 2015 08:19:11 +0000
- Subject: [Bug middle-end/68046] -ftrapv doesn't catch leaq-based overflows on x86-64
- Auto-submitted: auto-generated
- References: <bug-68046-4 at http dot gcc dot gnu dot org/bugzilla/>
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 ***