From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30674 invoked by alias); 6 Dec 2001 12:51:02 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30545 invoked from network); 6 Dec 2001 12:50:54 -0000 Received: from unknown (HELO mx7.port.ru) (194.67.57.17) by sources.redhat.com with SMTP; 6 Dec 2001 12:50:54 -0000 Received: from f7.int ([10.0.0.104] helo=f7.mail.ru) by mx7.port.ru with esmtp (Exim 3.14 #1) id 16BxzI-0000NZ-00; Thu, 06 Dec 2001 15:50:52 +0300 Received: from mail by f7.mail.ru with local (Exim 3.14 #1) id 16BxzH-000GHD-00; Thu, 06 Dec 2001 15:50:51 +0300 Received: from [195.201.69.15] by koi.mail.ru with HTTP; Thu, 06 Dec 2001 15:50:51 +0300 From: "dimmy the wild" To: rth@redhat.com Cc: gcc@gcc.gnu.org Subject: Re: Legitimize address, Please HELP! Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: 195.201.69.80 via proxy [195.201.69.15] Date: Thu, 06 Dec 2001 05:03:00 -0000 Reply-To: "dimmy the wild" Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: X-SW-Source: 2001-12/txt/msg00273.txt.bz2 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 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 *********************************************************************