public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "Marco Altieri" <maltieri@nergal.it> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: middle-end/5100: Wrong register class selected by find_valid_class Date: Mon, 15 Apr 2002 06:36:00 -0000 [thread overview] Message-ID: <20020415133601.4606.qmail@sources.redhat.com> (raw) The following reply was made to PR middle-end/5100; it has been noted by GNATS. From: "Marco Altieri" <maltieri@nergal.it> To: <rth@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>, <lonardo@nergal.it>, <maltieri@nergal.it>, <nobody@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org> Cc: Subject: Re: middle-end/5100: Wrong register class selected by find_valid_class Date: Mon, 15 Apr 2002 15:32:51 +0200 In a simplified example we have only 4 registers (named 0, 1, 2, 3) and 3 classes of registers: EVEN_REGS = { 0, 2 } ODD_REGS = { 1, 3 } GENERAL_REGS = { 0, 1, 2, 3 } A pointer can be reloaded only on even/odd pair. In this simplified example the possible pair are only (0, 1) and (2, 3). The macro HARD_REGNO_MODE_OK have to return a not null value for the Pmode mode only for registers 0 and 2: HARD_REGNO_MODE_OK(0, Pmode) = 1 HARD_REGNO_MODE_OK(1, Pmode) = 0 HARD_REGNO_MODE_OK(2, Pmode) = 1 HARD_REGNO_MODE_OK(3, Pmode) = 0 find_valid_class have to return GENERAL_REGS because EVEN_REGS and ODD_REGS have not any even/odd pair. But the algorithm, used in find_valid_class, rejects GENERAL_REGS and accepts EVEN_REGS. Infact when (regno == 0 || regno == 2) && m1 == Pmode && class == GENERAL_REGISTER && n == 1 we have: HARD_REGNO_MODE_OK (regno + n, m1) == 0 TEST_HARD_REG_BIT (reg_class_contents[class], regno) == 1 TEST_HARD_REG_BIT (reg_class_contents[class], regno + n) == 1 and when (regno == 0 || regno == 2) && m1 == Pmode && class == EVEN_REGS && n == 1 we have: HARD_REGNO_MODE_OK (regno + n, m1) == 0 TEST_HARD_REG_BIT (reg_class_contents[class], regno) == 1 TEST_HARD_REG_BIT (reg_class_contents[class], regno + n) == 0 So, the algorithm in find_valid_class selects EVEN_REGS for a mode == Pmode and n==1. thanks, Marco Altieri
next reply other threads:[~2002-04-15 13:36 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-04-15 6:36 Marco Altieri [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-01-14 23:12 bangerth 2002-04-15 10:06 Richard Henderson 2002-04-04 4:27 rth 2001-12-13 2:36 maltieri
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=20020415133601.4606.qmail@sources.redhat.com \ --to=maltieri@nergal.it \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).