From: Denis Chertykov <chertykov@gmail.com>
To: Georg-Johann Lay <avr@gjlay.de>
Cc: gcc-patches@gcc.gnu.org, Anatoly Sokolov <aesok@post.ru>,
"Eric B. Weddington" <eric.weddington@atmel.com>,
Richard Henderson <rth@redhat.com>
Subject: Re: [Patch, AVR]: Fix PR46779
Date: Tue, 14 Jun 2011 11:38:00 -0000 [thread overview]
Message-ID: <BANLkTim=EZDDtSxpE0b0aU7wjcxynsyUqg@mail.gmail.com> (raw)
In-Reply-To: <4DF73490.2080709@gjlay.de>
2011/6/14 Georg-Johann Lay <avr@gjlay.de>:
> Denis Chertykov schrieb:
>> 2011/6/13 Georg-Johann Lay <avr@gjlay.de>:
>>> So you think is is pointless/discouraged to give a more realistic
>>> description of AVR addressing be means of MODE_CODE_BASE_REG_CLASS (instead
>>> of BASE_REG_CLASS) resp. REGNO_MODE_CODE_OK_FOR_BASE_P?
>>>
>>>> Look carefully at `out_movqi_r_mr'.
>>>> There are even two fake addressing modes:
>>>> 1. [Y + infinite-dslacement];
>>>> 2. [X + (0...63)].
>>> Yes, I know. The first is introduced by avr_legitimate_address_p and the
>>> second appears to be artifact of LEGITIMIZE_RELOAD_ADDRESS.
>>>
>>> The changes are basically MODE_CODE_BASE_REG_CLASS (introduced in 4.2) and a
>>> rewrite of avr_legitimate_address_p. The changes aim at a better addressing
>>> for X and to minimize fake addresses.
>>>
>>>> I have spent a many hours (days, months) to debug GCC (especially avr port
>>>> and reload) for right addressing modes.
>>>> I have stopped on this code.
>>>> AVR have a limited memory addressing and GCC can't handle it in native
>>>> form.
>>>> Because of that I have supported a fake adddressing modes.
>>> I assume the code is from prior to 4.2 when REGNO_MODE_CODE_OK_FOR_BASE_P
>>> and MODE_CODE_BASE_REG_CLASS had not been available so that supporting X
>>> required some hacking.
>>> All that would still be fine; however the new register allocator leads to
>>> code that noone would accept. Accessing a structure through a pointer is not
>>> uncommon, not even on AVR. So if Z is used for, say accessing flash, X
>>> appears to be the best register.
>>>
>>> The shortcoming in GCC is that there is no way to give costs of addressing
>>> (TARGET_ADDRESS_COST does different things).
>>>
>>> So take a look what avr-gcc compiles here:
>>> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22242
>>> I saw similar complains in forums on the web.
>>>
>>>> (Richard Henderson have a different opinion: GCC can, AVR port can't)
>>> What does he mean with that?
>>>
>>>> IMHO that three limited pointer registers is not enough for C compiler.
>>>> Even more with frame pointer it's only two and X is a very limited.
>>> The current implementation has several oddities like
>>>
>>> * allowing SUBREGs in avr-legitimate_address_p
>>> * changing BASE_REG_CLASS on the fly (by means of reload_completed)
>>>
>>> isn't that supposed to cause trouble?
>>
>> You can try to remove all oddities and check results.
>> Definitely something changed in GCC core since I wrote addressing code.
>>
>>
>> Denis.
>
> For your interest, here is a patch that shows the changes in
> addressing mode.
Generally, the patch seems as a "right thing". I like it.
How about a regression testing and code quality.
Denis.
next prev parent reply other threads:[~2011-06-14 11:29 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 17:24 Georg-Johann Lay
2011-06-09 18:50 ` Denis Chertykov
2011-06-09 19:43 ` Georg-Johann Lay
2011-06-09 19:51 ` Denis Chertykov
2011-06-10 10:23 ` Georg-Johann Lay
2011-06-12 10:34 ` Denis Chertykov
2011-06-13 18:10 ` Georg-Johann Lay
2011-06-13 22:37 ` Denis Chertykov
2011-06-14 10:39 ` Georg-Johann Lay
2011-06-14 11:38 ` Denis Chertykov [this message]
2011-06-14 21:38 ` Georg-Johann Lay
2011-06-14 23:04 ` Richard Henderson
2011-06-15 17:58 ` Richard Henderson
2011-06-15 21:58 ` Georg-Johann Lay
2011-06-15 22:20 ` Richard Henderson
2011-06-16 3:46 ` Richard Henderson
2011-06-16 11:37 ` Denis Chertykov
2011-06-16 12:01 ` Denis Chertykov
2011-06-16 14:07 ` Richard Henderson
2011-06-16 18:18 ` Denis Chertykov
2011-06-16 18:57 ` Richard Henderson
2011-06-16 19:33 ` Denis Chertykov
2011-06-16 19:42 ` Richard Henderson
2011-06-16 20:04 ` Denis Chertykov
2011-06-16 14:36 ` Richard Henderson
2011-06-16 14:52 ` Bernd Schmidt
2011-06-16 15:13 ` Richard Henderson
2011-06-16 18:57 ` Denis Chertykov
2011-06-23 20:48 ` Denis Chertykov
2011-06-23 22:04 ` Richard Henderson
2011-06-26 20:03 ` Denis Chertykov
2011-06-26 20:51 ` Georg-Johann Lay
2011-06-27 8:41 ` Denis Chertykov
2011-06-27 9:19 ` Georg-Johann Lay
2011-06-27 10:17 ` Denis Chertykov
2011-07-07 9:59 ` Georg-Johann Lay
2011-07-07 18:21 ` Denis Chertykov
2011-07-08 10:12 ` Georg-Johann Lay
2011-07-08 10:25 ` Denis Chertykov
2011-07-08 12:16 ` Georg-Johann Lay
2011-06-22 3:28 ` Hans-Peter Nilsson
2011-06-22 17:03 ` Georg-Johann Lay
2011-06-23 12:51 ` Hans-Peter Nilsson
2011-06-23 13:00 ` Hans-Peter Nilsson
2011-06-09 20:03 ` Georg-Johann Lay
2011-06-10 9:27 ` Georg-Johann Lay
2011-06-21 17:17 ` Georg-Johann Lay
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='BANLkTim=EZDDtSxpE0b0aU7wjcxynsyUqg@mail.gmail.com' \
--to=chertykov@gmail.com \
--cc=aesok@post.ru \
--cc=avr@gjlay.de \
--cc=eric.weddington@atmel.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.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).