public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
Date: Wed, 09 Dec 2020 14:23:01 +0000	[thread overview]
Message-ID: <bug-97092-4-4Am0a9M2OM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97092-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092

--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Andrea Corallo from comment #3)
> Created attachment 49710 [details]
> PR97092.patch
> 
> What is going on is that in 'update_costs_from_allocno' we try to
> identify the smallest mode using narrower_subreg_mode to then update the
> costs.
> 
> The two modes involved here are E_DImode and E_VNx2QImode, cause these
> are not ordered we ICE in 'paradoxical_subreg_p'.
> 
> Now I don't know if the strategy we want is:
> 
> - In 'update_costs_from_allocno' when modes are not ordered instead of
>   calling 'narrower_subreg_mode' just keep the current one.
> 
> - Always select the cheapest mode in terms of cost.
> 
> The attached I'm testing implements the second.
I think instead we should consider recomputing “mode” in each
iteration of the loop, rather than carry over the result of
previous iterations.  I.e. use:

    mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
                                 ALLOCNO_MODE (cp->second));

instead of:

    mode = narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second));

Before g:e2323a2b77c91d1ba8194b01e6deaa2e00f15990 “mode”
was a loop invariant, so it made sense to set it outside
the loop.  I think the intention of that patch was to use
the smaller of the two modes involved in the copy, and carrying
the result over to future copies might have been unintentional.

The difficulty with carrying the mode over to later copies
is that the costs then become dependent on the order of
the copies, whereas I'm not sure the order of the copies
is significant.

  parent reply	other threads:[~2020-12-09 14:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 16:51 [Bug rtl-optimization/97092] New: " acoplan at gcc dot gnu.org
2020-09-18  6:10 ` [Bug rtl-optimization/97092] " rguenth at gcc dot gnu.org
2020-12-08 16:12 ` akrl at gcc dot gnu.org
2020-12-08 16:25   ` Andrea Corallo
2020-12-08 16:26 ` andrea.corallo at arm dot com
2020-12-09  9:57   ` Andrea Corallo
2020-12-09  9:58 ` andrea.corallo at arm dot com
2020-12-09 14:23 ` rsandifo at gcc dot gnu.org [this message]
2020-12-09 16:38   ` Andrea Corallo
2020-12-09 16:39 ` andrea.corallo at arm dot com
2020-12-09 16:51 ` rsandifo at gcc dot gnu.org
2020-12-09 17:06   ` Andrea Corallo
2020-12-09 17:07 ` andrea.corallo at arm dot com
2020-12-11  9:37 ` cvs-commit at gcc dot gnu.org
2020-12-11 16:29 ` acoplan at gcc dot gnu.org
2020-12-11 16:56   ` Andrea Corallo
2020-12-11 16:56 ` andrea.corallo at arm dot com
2020-12-15 10:03 ` cvs-commit at gcc dot gnu.org
2021-01-12 10:04 ` acoplan at gcc dot gnu.org

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=bug-97092-4-4Am0a9M2OM@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).