From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23453 invoked by alias); 8 Sep 2011 13:28:34 -0000 Received: (qmail 23445 invoked by uid 22791); 8 Sep 2011 13:28:33 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Sep 2011 13:28:19 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/50328] New: loop interchange confuses vectorizer Date: Thu, 08 Sep 2011 13:30: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-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2011-09/txt/msg00599.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50328 Bug #: 50328 Summary: loop interchange confuses vectorizer Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: rguenth@gcc.gnu.org CC: irar@gcc.gnu.org For double dvec[256]; void test (void) { long i, j; for (j = 0; j < 131072; ++j) for (i = 0; i < 256; ++i) dvec[i] *= 1.0000001; } the loops are interchanged with -Ofast -floop-interchange but the vectorizer is confused by the extra IV lim inserts: : # graphite_IV.6_21 = PHI <0(3), graphite_IV.6_22(5)> # dvec_I_lsm.7_26 = PHI # ivtmp.9_19 = PHI <131072(3), ivtmp.9_29(5)> D.2732_25 = dvec_I_lsm.7_26 * 1.0000001000000000583867176828789524734020233154296875e+0; graphite_IV.6_22 = graphite_IV.6_21 + 1; ivtmp.9_29 = ivtmp.9_19 - 1; if (ivtmp.9_29 != 0) goto ; else goto ; : goto ; this isn't detected as reduction for some reason.