public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix expand_binop (PR middle-end/88032)
Date: Fri, 16 Nov 2018 15:41:00 -0000	[thread overview]
Message-ID: <23831dc2-5664-6917-6d09-19e4e3640f49@redhat.com> (raw)
In-Reply-To: <20181116084950.GE11625@tucnak>

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  <jakub@redhat.com>
> 
> 	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

      reply	other threads:[~2018-11-16 15:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 16:35 [committed] Fix rl78 newlib build failure due to bogus operand_subword_force argument Jeff Law
2018-11-16  8:49 ` [PATCH] Fix expand_binop (PR middle-end/88032) Jakub Jelinek
2018-11-16 15:41   ` Jeff Law [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23831dc2-5664-6917-6d09-19e4e3640f49@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).