public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ulrich Weigand <weigand@immd1.informatik.uni-erlangen.de>
To: amylaar@onetel.net.uk (Joern Rennecke)
Cc: weigand@immd1.informatik.uni-erlangen.de (Ulrich Weigand),
	gcc@gcc.gnu.org, uweigand@de.ibm.com, hpenner@de.ibm.com
Subject: Re: find_reloads_address_1 question
Date: Sun, 07 Oct 2001 15:01:00 -0000	[thread overview]
Message-ID: <200110072201.AAA05109@faui11.informatik.uni-erlangen.de> (raw)
In-Reply-To: <200110072025.VAA00656@meolyon.local>

Joern Rennecke wrote:

> > Specifically I've tried to declare addresses of the form
> >  (plus (plus (reg) (const_int)) (plus (reg) (const_int)))
> ...
> > But this caused bootstrap failure because reload simply
> > didn't reload the registers to hard registers and left
> > pseudos in ...
> > 
> > Am I just trying something stupid here, or would this be
> > considered a bug in reload?
> 
> Yes.  Both.  You are allowing non-canonical RTL, and AFAICT there is
> no good reason to do this here. 

Well, I tried this change because a pattern of the type above
was generated by combine through substing into an address.  The
combine attempt then failed because the address didn't pass the
LEGITIMATE_ADDRESS test, and so I thought it was my fault for not
accepting everything that can in fact be translated to a correct
address.

However, if there is a canonical form for addresses that reload
depends upon (across all architectures), then I guess combine
would be at fault here for not properly canonifying addresses
after substing into them ...  I'll reexamine my test case and
try to find out what's going on here.

> On the other hand, gcc would be easier
> to port if find_reloads_address either had a fallback method to reload
> all kinds of addressing modes, or at least aborted for ones that it
> doesn't handle.  Note that there is a comment at the start of this function
> that hints at this defect:  ...this is not fully machine-customizable;... .

After a closer look at find_reloads_address_1 I guess I understand
why it doesn't simply recurse over subexpressions: it tries to 
decide which operand of the PLUS to use as base and which as index
for those architectures where the sets of possible base and index
registers are not equal.  Do to so you basically have to analyse
both operands of the PLUS ... (This is not the case on our architecture,
which is probably why I overlooked this problem.)

But I certainly agree that aborting in this case would be preferable
to just leaving an incorrect address in.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de

  reply	other threads:[~2001-10-07 15:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-30 17:46 Ulrich Weigand
2001-10-07 13:28 ` Joern Rennecke
2001-10-07 15:01   ` Ulrich Weigand [this message]
2001-10-07 16:04     ` Joern Rennecke
2001-10-17 11:31       ` Ulrich Weigand
2001-10-17 19:01         ` Joern Rennecke
2001-10-18 10:04 Ulrich Weigand

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=200110072201.AAA05109@faui11.informatik.uni-erlangen.de \
    --to=weigand@immd1.informatik.uni-erlangen.de \
    --cc=amylaar@onetel.net.uk \
    --cc=gcc@gcc.gnu.org \
    --cc=hpenner@de.ibm.com \
    --cc=uweigand@de.ibm.com \
    /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).