public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: middle-end/5100: Wrong register class selected by find_valid_class
@ 2002-04-15 10:06 Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2002-04-15 10:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR middle-end/5100; it has been noted by GNATS.

From: Richard Henderson <rth@redhat.com>
To: Marco Altieri <maltieri@nergal.it>
Cc: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   lonardo@nergal.it, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: middle-end/5100: Wrong register class selected by find_valid_class
Date: Mon, 15 Apr 2002 10:03:47 -0700

 On Mon, Apr 15, 2002 at 03:32:51PM +0200, Marco Altieri wrote:
 > So, the algorithm in find_valid_class selects EVEN_REGS for a
 > mode == Pmode and n==1.
 
 Sounds like you should actually get an abort, since no class is
 valid for Pmode.  Seems to me your bug is that Pmode should be
 able to be *held* in any pair of registers, odd or even, but can
 only be *used* in even registers.
 
 
 r~


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: middle-end/5100: Wrong register class selected by find_valid_class
@ 2003-01-14 23:12 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-01-14 23:12 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, lonardo, maltieri, nobody

Synopsis: Wrong register class selected by find_valid_class

State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Tue Jan 14 15:12:49 2003
State-Changed-Why:
    No feedback.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5100


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: middle-end/5100: Wrong register class selected by find_valid_class
@ 2002-04-15  6:36 Marco Altieri
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Altieri @ 2002-04-15  6:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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
 
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: middle-end/5100: Wrong register class selected by find_valid_class
@ 2002-04-04  4:27 rth
  0 siblings, 0 replies; 5+ messages in thread
From: rth @ 2002-04-04  4:27 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, lonardo, maltieri, nobody

Synopsis: Wrong register class selected by find_valid_class

State-Changed-From-To: open->feedback
State-Changed-By: rth
State-Changed-When: Thu Apr  4 04:27:28 2002
State-Changed-Why:
    There's not really enough information here to understand
    what exactly is going on.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5100


^ permalink raw reply	[flat|nested] 5+ messages in thread

* middle-end/5100: Wrong register class selected by find_valid_class
@ 2001-12-13  2:36 maltieri
  0 siblings, 0 replies; 5+ messages in thread
From: maltieri @ 2001-12-13  2:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: lonardo


>Number:         5100
>Category:       middle-end
>Synopsis:       Wrong register class selected by find_valid_class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 13 02:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Marco Altieri
>Release:        3.0
>Organization:
>Environment:
Linux 7.0.
>Description:
We are devoloping a porting of gcc to a new DSP architecture
that has pointers whith a size of 2 registers.
A pointer must always be allocated on a even/odd pair
of registers.
HARD_REGNO_MODE_OK macro returns 0 for all the odd
registers when the mode is Pmode.
There are classes for even registers (EVEN_REGS), odd
registers (ODD_REGS) and all the general registers
(GENERAL_REGS).
The algorithm used by find_valid_class rejects
GENERAL_REGS class for a Pmode subreg and returns
EVEN_REGS.
This is incorrect because a double-sized mode can not
be allocated in EVEN_REGS class.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-01-14 23:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-15 10:06 middle-end/5100: Wrong register class selected by find_valid_class Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2003-01-14 23:12 bangerth
2002-04-15  6:36 Marco Altieri
2002-04-04  4:27 rth
2001-12-13  2:36 maltieri

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).