From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19392 invoked by alias); 9 Jan 2015 07:08:11 -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 19346 invoked by uid 55); 9 Jan 2015 07:08:06 -0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64286] Redundant extend removal ignores vector element type Date: Fri, 09 Jan 2015 07:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: law at redhat 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: 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/msg00549.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64286 --- Comment #2 from Jeffrey A. Law --- On 12/16/14 09:10, izamyatin at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64286 > > --- Comment #1 from Igor Zamyatin --- > Perhaps something like below to restrict ree for such cases? > > diff --git a/gcc/ree.c b/gcc/ree.c > index 3376901..92370ea 100644 > --- a/gcc/ree.c > +++ b/gcc/ree.c > @@ -1004,6 +1004,11 @@ add_removable_extension (const_rtx expr, rtx_insn *insn, > struct df_link *defs, *def; > ext_cand *cand; > > + if (!SCALAR_INT_MODE_P (GET_MODE (dest)) > + && (GET_MODE_UNIT_PRECISION (mode) != > + GET_MODE_UNIT_PRECISION (GET_MODE (XEXP (src, 0))))) > + return; > + > /* First, make sure we can get all the reaching definitions. */ > defs = get_defs (insn, XEXP (src, 0), NULL); > if (!defs) > Funny, this is exactly the situation Jakub was concerned about in a comment for PR 59754. I think you should remove the SCALAR_INT_MODE_P test in combine_reaching_defs which I think should be dead code if we filter things in add_removable_extension. If you could make that change and confirm with Kirill that avx512f still looks good (in particular avx512f-vpmovzxwd-2.c) as well as doing a bootstrap and regression test, it'd be appreciated. Thanks, jeff