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>, Bernd Schmidt <bschmidt@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix expansion ICE on stores into parts of hard registers (PR middle-end/80173)
Date: Fri, 31 Mar 2017 06:27:00 -0000	[thread overview]
Message-ID: <3446b66e-c740-f44f-5710-53ee3a2d7f7c@redhat.com> (raw)
In-Reply-To: <20170330203839.GP17461@tucnak>

On 03/30/2017 02:38 PM, Jakub Jelinek wrote:
> Hi!
>
> On some arches like x86_64 we allow some aggregates in named register
> variables.  If those registers are wider than word, store_bit_field_1
> was assuming it must be multiple registers and attempted to pick
> a word sized subregister of it, which is fine for pseudos, but if the
> destination is a hard register, sometimes such subreg will fail.
> If it is a hard register and we know that its mode means a single
> register (otherwise we wouldn't allow creating a named register variable for
> it), then that subreg is certainly counter-productive, we just want to store
> into the whole register.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-03-30  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR middle-end/80173
> 	* expmed.c (store_bit_field_1): Don't attempt to create
> 	a word subreg out of hard registers wider than word if they
> 	have HARD_REGNO_NREGS of 1 for their mode.
>
> 	* gcc.target/i386/pr80173.c: New test.
I could easily argue that we shouldn't ever create subregs of hardregs. 
They should either be rejected or simplified into normal reg 
expressions.  There's been many bugs in the past due to these kinds of 
problems.

This patch clearly fits that general guidance.

OK for the trunk and any release branches where you want to backport it.

jeff

      reply	other threads:[~2017-03-31  6:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 21:33 Jakub Jelinek
2017-03-31  6:27 ` 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=3446b66e-c740-f44f-5710-53ee3a2d7f7c@redhat.com \
    --to=law@redhat.com \
    --cc=bschmidt@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).