From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27277 invoked by alias); 25 Mar 2014 16:02:55 -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 27257 invoked by uid 48); 25 Mar 2014 16:02:51 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/60656] New: [4.8/4.9 regression] x86 vectorization produces wrong code Date: Tue, 25 Mar 2014 16:02:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google 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-03/txt/msg02285.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60656 Bug ID: 60656 Summary: [4.8/4.9 regression] x86 vectorization produces wrong code Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Current trunk (r208813) and gcc-4.8 are affected, 4.7 does not appear to be. gcc -O0 t.c && ./a.out 500450210036 gcc -O3 t.c && ./a.out 500450200033 gcc -O2 t.c && ./a.out 500450210036 gcc -O2 t.c -ftree-vectorize && ./a.out 500450200033 // t.c #include int main () { int v[] = {5000, 5001, 5002, 5003}; long s = 0; int i; for(i = 0; i < 4; ++i) { long P = v[i]; s += P*P*P; } printf("%ld\n", s); }