public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/114766] ^ constraint modifier unexpectedly affects register class selection.
Date: Wed, 24 Apr 2024 12:38:11 +0000	[thread overview]
Message-ID: <bug-114766-4-SApnQjcdQW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114766-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Tamar Christina from comment #2)
> (In reply to Vladimir Makarov from comment #1)
> > (In reply to Tamar Christina from comment #0)
> > > The documentation for ^ states:
> >
> > If it works for you, we could try to use the patch (although it needs some
> > investigation how other targets uses the hint).  In any case, the
> > documentation should be modified or made more clear depending on applying or
> > not applying the patch.
> 
> Yeah, using the patch gives us the behavior we expected, we added a
> workaround for now so we can investigate what other targets do in GCC 15.
> 
> But while looking at this we also got some unexpected behavior with using ?
> 

> 
>   r103 costs: W8_W11_REGS:2000 W12_W15_REGS:2000 TAILCALL_ADDR_REGS:2000
> STUB_REGS:2000 GENERAL_REGS:2000 FP_LO8_REGS:0 FP_LO_REGS:0 FP_REGS:0
> POINTER_AND_FP_REGS:7000 MEM:9000
> 
> In this particular pattern the ? isn't needed so we're removing it, but the
> behavior is still unexpected.

'?' is a very old hint (unlike ^ and @).  It is used by all targets for many
years.  IRA cost calculation uses exactly the same algorithm as it was in now
non-existing regclass.c file.  Changing code related to processing '?' would
have very unpredictable consequences for many targets.  After many years
working on RA, I am still surprised how fragile code calculating costs and reg
classes and how insignificant changes can result in a cascade of GCC test
failures.

There are many factors which still can result in zero cost code even when '?'
is used.  You can try to use more one '?' and see what happens.  If the cost is
still zero, I could look what is going on in the cost calculation.

      parent reply	other threads:[~2024-04-24 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 12:01 [Bug rtl-optimization/114766] New: " tnfchris at gcc dot gnu.org
2024-04-19 22:04 ` [Bug rtl-optimization/114766] " vmakarov at gcc dot gnu.org
2024-04-20 15:24 ` tnfchris at gcc dot gnu.org
2024-04-24 12:38 ` vmakarov at gcc dot gnu.org [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=bug-114766-4-SApnQjcdQW@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).