From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3640 invoked by alias); 8 Aug 2014 08:05:29 -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 3406 invoked by uid 48); 8 Aug 2014 08:05:25 -0000 From: "zeccav at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/62058] New: Undefined behaviour in tree-data-ref.c with options -O1 -ftree-loop-vectorize Date: Fri, 08 Aug 2014 08:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: zeccav at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter 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-08/txt/msg00509.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62058 Bug ID: 62058 Summary: Undefined behaviour in tree-data-ref.c with options -O1 -ftree-loop-vectorize Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zeccav at gmail dot com /* from testsuite p60183.c */ /* gcc 4.9.1 -S -O1 -ftree-loop-vectorize */ /* ../../gcc-4.9.1/gcc/tree-data-ref.c:2423:16: runtime error: signed integer overflow: 65536 * -65536 cannot be represented in type 'int' */ /* ../../gcc-4.9.1/gcc/tree-data-ref.c:2334:38: runtime error: signed integer overflow: 1073741824 + 1073741824 cannot be represented in type 'int' */ /* ../../gcc-4.9.1/gcc/tree-data-ref.c:2425:16: runtime error: negation of -2147483648 (INT_MIN) cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself */ /* ../../gcc-4.9.1/gcc/tree-data-ref.c:2424:16: runtime error: negation of -2147483648 (INT_MIN) cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself */ /* on x86-64 from testsuite pr60183.c */ unsigned char c[0x30001] = { 1 }; int j = 0; /* independent of the j initialization value */ static void foo (unsigned long *x, unsigned char *y) { int i; unsigned long w = x[0]; for (i = 0; i < j; i++) { w += *y; y += 0x10000; w += *y; } x[1] = w; } void bar (unsigned long *x) { foo (x, c); }