public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/109610] [14 regression] gcc.target/powerpc/dform-3.c fails after r14-172-g0368d169492017
Date: Tue, 25 Apr 2023 09:15:25 +0000	[thread overview]
Message-ID: <bug-109610-4-miuBUJK8bt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109610-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Hongtao.liu <crazylht at gmail dot com> ---
testcase:

#ifndef TYPE
#define TYPE vector double
#endif

struct foo {
  TYPE a, b, c, d;
};

/* Make sure we don't use direct moves to get stuff into GPR registers.  */
void
gpr (struct foo *p)
{
  TYPE x = p->c;

  __asm__ (" # reg = %0" : "+r" (x));

  p->b = x;
}


Here's dump in ira.

-------------
a2(r117,l0) costs: BASE_REGS:12000,12000 GENERAL_REGS:12000,12000
FLOAT_REGS:0,0 ALTIVEC_REGS:0,0 VSX_REGS:0,0 GEN_OR_FLOAT_REGS:12000,12000
GEN_OR_VSX_REGS:12000,12000 MEM:0,0
....
(insn 6 3 13 2 (set (reg/v:V2DF 117 [ x ])
        (mem:V2DF (plus:DI (reg/v/f:DI 118 [ p ])
                (const_int 32 [0x20])) [1 p_2(D)->c+0 S16 A128]))
"testsuite/gcc.target/powerpc/dform-3.c":23:8 1148 {vsx_movv2df_64bit}
     (nil))
(insn 13 6 8 2 (set (reg:V2DF 119 [ x ])
        (reg/v:V2DF 117 [ x ])) "testsuite/gcc.target/powerpc/dform-3.c":25:3
-1
     (nil))
(insn 8 13 9 2 (parallel [
            (set (reg:V2DF 119 [ x ])
                (asm_operands:V2DF (" # reg = %0") ("=r") 0 [
                        (reg:V2DF 119 [ x ])
                    ]
                     [
                        (asm_input:V2DF ("0")
testsuite/gcc.target/powerpc/dform-3.c:25)
                    ]
                     [] testsuite/gcc.target/powerpc/dform-3.c:25))
            (clobber (reg:SI 98 ca))
        ]) "testsuite/gcc.target/powerpc/dform-3.c":25:3 -1
---------------


And after my commit, RA take best scenario when preferred reg_class is unkown,
which make cost of MEM:0,0 of r117 same as VSX_REGS:0,0, and allocate r117 as
VSX_REGS, which create an extra move and failed the testcase.

  parent reply	other threads:[~2023-04-25  9:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24 19:45 [Bug target/109610] New: [14 regression] gcc.target/powerpc/dform-3.c fails after seurer at gcc dot gnu.org
2023-04-25  2:59 ` [Bug target/109610] [14 regression] gcc.target/powerpc/dform-3.c fails after r14-172-g0368d169492017 crazylht at gmail dot com
2023-04-25  6:31 ` rguenth at gcc dot gnu.org
2023-04-25  9:15 ` crazylht at gmail dot com [this message]
2023-04-25  9:31 ` crazylht at gmail dot com
2023-04-26  3:14 ` crazylht at gmail dot com
2023-04-26  6:41 ` crazylht at gmail dot com
2023-04-26 14:15 ` rsandifo at gcc dot gnu.org
2023-04-27  1:36 ` crazylht at gmail dot com
2023-04-27 16:22 ` bergner at gcc dot gnu.org
2023-05-06  5:46 ` crazylht at gmail dot com
2023-05-15  8:39 ` segher at gcc dot gnu.org
2023-05-15  8:40 ` segher at gcc dot gnu.org
2023-05-17  6:05 ` linkw at gcc dot gnu.org
2023-05-26  1:46 ` cvs-commit at gcc dot gnu.org
2023-05-26  1:47 ` crazylht at gmail dot com
2023-06-02 22:56 ` bergner at gcc dot gnu.org
2023-06-06 19:44 ` seurer 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-109610-4-miuBUJK8bt@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).