From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28303 invoked by alias); 14 Jan 2015 12:44:36 -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 28265 invoked by uid 48); 14 Jan 2015 12:44:30 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64365] [4.9/5 Regression] Predictive commoning after loop vectorization produces incorrect code. Date: Wed, 14 Jan 2015 12:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_known_to_work short_desc cf_known_to_fail Message-ID: In-Reply-To: References: 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: 2015-01/txt/msg01184.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64365 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work|4.9.2 |4.8.3 Summary|[5 Regression] Predictive |[4.9/5 Regression] |commoning after loop |Predictive commoning after |vectorization produces |loop vectorization produces |incorrect code. |incorrect code. Known to fail| |4.9.2 --- Comment #5 from Richard Biener --- Testcase that also fails on the 4.9 branch: extern void abort (void); extern int memcmp (const void * , const void *, __SIZE_TYPE__); void __attribute__((noinline,noclone)) foo(int *in) { int i; for (i = 62; i >= 10; i--) { in[i - 8] -= in[i]; in[i - 5] += in[i] * 2; in[i - 4] += in[i]; } } int main() { int x[64]; int y[64] = { 0, 1, -2380134, -1065336, -1026376, 3264240, 3113534, 2328130, 3632054, 3839634, 2380136, 1065339, 1026380, 1496037, 1397286, 789976, 386408, 450984, 597112, 497464, 262008, 149184, 194768, 231519, 173984, 87753, 60712, 82042, 87502, 60014, 30050, 25550, 33570, 32386, 20464, 10675, 10868, 13329, 11794, 6892, 3988, 4564, 5148, 4228, 2284, 1568, 1848, 1943, 1472, 741, 628, 702, 714, 474, 230, 234, 238, 242, 120, 59, 60, 61, 62, 63 }; int i; for (i = 0; i < 64; ++i) { x[i] = i; __asm__ volatile (""); } foo (x); if (memcmp (x, y, sizeof (x)) != 0) abort (); return 0; }