From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13469 invoked by alias); 28 Jan 2015 14:06:39 -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 13382 invoked by uid 48); 28 Jan 2015 14:06:35 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64829] [ARM] ICE at -O3 in vect_get_vec_def_for_stmt_copy Date: Wed, 28 Jan 2015 14:06: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: ice-on-valid-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: --- 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: 2015-01/txt/msg03242.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64829 --- Comment #6 from Richard Biener --- In fact we recognize a widening shift but it gets dropped on the floor: t.c:48:2: note: ------>vectorizing statement: result_15 = val0_14 << 4; t.c:48:2: note: ------>vectorizing statement: _17 = val1_16(D) - val0_14; huh? The issue that we hit is that we vectorized the def of val0_14 with ncopies == 1 but now require two copies of it when vectorizing val1_16(D) - val0_14. So maybe the shift issue is unrelated. Sofar we have vect__13.17_155 = MEM[(const Uint8 *)vectp_pCornerPoint0.15_153]; _13 = *pCornerPoint0_48; vect__41.18_156 = [vec_unpack_lo_expr] vect__13.17_155; vect__41.18_157 = [vec_unpack_hi_expr] vect__13.17_155; val0_14 = (Sint32) _13; Thus we widen a char load to an int but the vectorized version widens to an unsigned short only. That's probably because of the consumer result_15 = val0_14 << 4; which was pattern detected as widening shift. But unfortunately that isn't the only one and we forgot _17 = val1_16(D) - val0_14; which then results in the ICE. Index: gcc/tree-vect-patterns.c =================================================================== --- gcc/tree-vect-patterns.c (revision 220205) +++ gcc/tree-vect-patterns.c (working copy) @@ -1732,9 +1732,11 @@ vect_recog_widen_shift_pattern (vec