From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19019 invoked by alias); 16 Nov 2018 15:41:29 -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 19010 invoked by uid 89); 16 Nov 2018 15:41:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 ESMTP; Fri, 16 Nov 2018 15:41:27 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A93F307D867 for ; Fri, 16 Nov 2018 15:41:26 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-27.rdu2.redhat.com [10.10.112.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93112101962A; Fri, 16 Nov 2018 15:41:25 +0000 (UTC) Subject: Re: [PATCH] Fix expand_binop (PR middle-end/88032) To: Jakub Jelinek Cc: gcc-patches References: <20181116084950.GE11625@tucnak> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <23831dc2-5664-6917-6d09-19e4e3640f49@redhat.com> Date: Fri, 16 Nov 2018 15:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181116084950.GE11625@tucnak> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg01463.txt.bz2 On 11/16/18 1:49 AM, Jakub Jelinek wrote: > Hi! > > On Wed, Nov 14, 2018 at 09:35:30AM -0700, Jeff Law wrote: >> + * optabs.c (expand_binop): Pass INT_MODE to operand_subword_force >> + iff the operand is a constant. > > This broke gcc.target/i386/pr80173.c testcase. The problem is > that while operand_subword handles VOIDmode last argument just fine > by using GET_MODE (op), so it is only important to use non-VOIDmode if > op has VOIDmode. But, operand_subword_force actually has a different > behavior, if mode is VOIDmode (or BLKmode), it acts just as operand_subword > followed by assertion that it succeeded, rather than by trying to deal with > failed operand_subword by forcing it into a pseudo. > > In the testcase, op is a hard register, on which operand_subword fails, but > if it is forced into pseudo, it succeeds. > > The following patch arranges it by never passing VOIDmode to > operand_subword_force, pass int_mode as previously if opN has VOIDmode, but > instead of passing VOIDmode otherwise pass the actual mode of the opN > operand. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2018-11-16 Jakub Jelinek > > PR middle-end/88032 > * optabs.c (expand_binop): For op0_mode use GET_MODE (op0), unless it > is VOIDmode, in which case use int_mode. Similarly for op1_mode. Yea, that's fine too -- I had this variant in my tree until the last cycle of testing where I changed it to VOIDmode :-) Sorry for the breakage. jeff