From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28797 invoked by alias); 21 Mar 2014 14:44:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28740 invoked by uid 48); 21 Mar 2014 14:44:37 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/60613] New: Invalid signed subtraction ubsan diagnostics Date: Fri, 21 Mar 2014 14:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg01972.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60613 Bug ID: 60613 Summary: Invalid signed subtraction ubsan diagnostics Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: sanitizer Assignee: jakub at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org On x86_64-linux with -O2 -m32 -fsanitize=undefined on: __attribute__((noinline, noclone)) long long foo (long long y) { asm (""); return 8LL - y; } int main () { foo (1); return 0; } we get invalid diagnostics: runtime error: signed integer overflow: 8 - 1 cannot be represented in type 'long long int'