From: "dimmy the wild" <diwil@mail.ru>
To: rth@redhat.com
Cc: gcc@gcc.gnu.org
Subject: Re: Legitimize address, Please HELP!
Date: Thu, 06 Dec 2001 05:03:00 -0000 [thread overview]
Message-ID: <E16BxzH-000GHD-00@f7.mail.ru> (raw)
Richard,
thanks...
I set it up as:
/* accept X(Rn) : (Rn + X) points to the operand address*/
if (GET_CODE (operand) == PLUS
&& GET_CODE (XEXP (operand, 0)) == REG
&& CONSTANT_ADDRESS_P (XEXP (operand, 1))
&&(strict ? REG_OK_FOR_BASE_STRICT_P (XEXP (operand, 0))
: REG_OK_FOR_BASE_NOSTRICT_P (XEXP (operand, 0)))
)
goto granded;
Did not help eather.
Also, I found, that if fails to compile the following:
static /* inline */ fde *
binary_search_mixed_encoding_fdes (struct object *ob, void *pc)
{
#ifdef WILL_CRASH_IF_NOT_DEFINED
char tt[20];
#endif
struct fde_vector *vec = ob->u.sort; /* THIS LEADS TO INCORRECT CODE */
size_t lo, hi;
#ifdef WILL_CRASH_IF_NOT_DEFINED
/* this is not a part of unwind-dw2-fde.c
but these two dummie calls helping gcc to produce correct code!!!
*/
set(vec->array,&lo,&hi,tt);
reset(vec,tt, lo,hi);
#endif
for (lo = 0, hi = vec->count; lo < hi; )
{
size_t i = (lo + hi) / 2;
fde *f = vec->array[i];
_Unwind_Ptr pc_begin, pc_range;
const char *p;
int encoding;
encoding = get_fde_encoding (f);
p = read_encoded_value_with_base (encoding,
base_from_object (encoding,
ob),
f->pc_begin, &pc_begin);
read_encoded_value_with_base (encoding & 0x0F, 0, p, &pc_range);
if ((_Unwind_Ptr)pc < pc_begin)
hi = i;
else if ((_Unwind_Ptr)pc >= pc_begin + pc_range )
lo = i + 1;
else
return f;
}
return 0;
}
which is a part of unwind-dw2-fde.c
But, guring gcc build xgcc does not complain about wrong operand (assembler
does), but if I run
cc1 it says:
unwind-dw2-fde.c: In function `search_object':
unwind-dw2-fde.c:930: Unrecognizable insn:
(insn 1212 29 30 (set (reg:HI 14 r14 [49])
(mem/s:HI (plus:HI (mem:HI (plus:HI (reg/f:HI 1 r1)
(const_int 12 [0xc])) 0)
(const_int 10 [0xa])) 13)) -1 (nil)
One more thing:
The function above is inlined in unwind-dw2-fde.c
Any sort of optimization results as wrong operand,
Absemse of optimization results Unrecognizable insn.
The example above can be compiled without optimization fine.
With -Ox it produces wrong code but does not complain about
wron addressing mode.
Does anybody have any idea why?
If you want I can send you complete sources of the gcc port.
Thanks in advance,
Dmitry.
On Wed, 5 Dec 2001 15:51:13 -0800
Richard Henderson <rth@redhat.com> wrote:
> On Wed, Dec 05, 2001 at 03:33:37PM +0300, dimmy wrote:
> > if (GET_CODE (operand) == PLUS
> > && GET_CODE (XEXP (operand, 0)) == REG
> > && REG_OK_FOR_BASE_P (XEXP (operand, 0))
>
> Should depend on strict here.
>
>
> r~
>
*********************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys
(_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 314-8860, 5585314
*********************************************************************
next reply other threads:[~2001-12-06 12:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-06 5:03 dimmy the wild [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-12-05 3:36 dimmy
2001-12-05 7:31 ` Jan Hubicka
2001-12-05 8:23 ` dimmy
2001-12-05 9:16 ` Jan Hubicka
[not found] ` <3C0E6806.3060706@mail.ru>
2001-12-05 9:52 ` Jan Hubicka
2001-12-05 11:14 ` dimmy
2001-12-05 11:23 ` Jan Hubicka
2001-12-05 15:52 ` Richard Henderson
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=E16BxzH-000GHD-00@f7.mail.ru \
--to=diwil@mail.ru \
--cc=gcc@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).