From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24059 invoked by alias); 20 Feb 2014 12:00:58 -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 24021 invoked by uid 48); 20 Feb 2014 12:00:55 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/60276] [4.7/4.8/4.9 Regression] -O3 autovectorizer breaks on a particular loop Date: Thu, 20 Feb 2014 12:00: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: 4.8.2 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: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2014-02/txt/msg02102.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60276 --- Comment #4 from Richard Biener --- extern void abort (void); static void foo (short *out, const short *lp, const short *hp, unsigned samples) { int x, target; for (x = 0, target = 0; x < (int)samples; x += 2, target++) { out[x + 0] = lp[target] - ((hp[target] + hp[target - 1] + 2) >> 2); out[x - 1] = hp[target - 1] + ((out[x - 2] + out[x]) >> 1); } } int main(void) { const short lp[25] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, }; const short hp[25] = {0}; short out[49] = {0}; int s; out[0] = lp[0] - (((hp[0] << 1) + 2) >> 2); foo (out + 2, lp + 1, hp + 1, 48); for (s = 0; s < 49; s++) if (out[s] != s) abort (); return 0; }