From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10981 invoked by alias); 1 Sep 2014 08:48:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10912 invoked by uid 89); 1 Sep 2014 08:48:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 01 Sep 2014 08:48:05 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s818m3Bv012459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 Sep 2014 04:48:03 -0400 Received: from tucnak.zalov.cz (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s818m1uB020913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 1 Sep 2014 04:48:02 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.8/8.14.7) with ESMTP id s818m0NW002069; Mon, 1 Sep 2014 10:48:00 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.8/8.14.8/Submit) id s818lweS002068; Mon, 1 Sep 2014 10:47:58 +0200 Date: Mon, 01 Sep 2014 08:48:00 -0000 From: Jakub Jelinek To: Uros Bizjak Cc: Richard Biener , "gcc-patches@gcc.gnu.org" , Kugan Subject: Re: [PATCH 2/2] Enable elimination of zext/sext Message-ID: <20140901084758.GI17454@tucnak.redhat.com> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00020.txt.bz2 On Wed, Aug 27, 2014 at 12:25:14PM +0200, Uros Bizjak wrote: > Something like following (untested) patch that also fixes the testcase perhaps? > > -- cut here-- > Index: cfgexpand.c > =================================================================== > --- cfgexpand.c (revision 214445) > +++ cfgexpand.c (working copy) > @@ -3322,6 +3322,7 @@ expand_gimple_stmt_1 (gimple stmt) > > if ((SUBREG_PROMOTED_GET (target) == SRP_SIGNED_AND_UNSIGNED) > && (GET_CODE (temp) == SUBREG) > + && SUBREG_PROMOTED_VAR_P (temp) > && (GET_MODE (target) == GET_MODE (temp)) > && (GET_MODE (SUBREG_REG (target)) == GET_MODE > (SUBREG_REG (temp)))) Looks like a wrong order of the predicates in any case, first you should check if it is a SUBREG, then SUBREG_PROMOTED_VAR_P and only then SUBREG_PROMOTED_GET. Also, the extra ()s around single line conditions are unnecessary. > emit_move_insn (SUBREG_REG (target), SUBREG_REG (temp)); > -- cut here > > Uros. Jakub