From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15262 invoked by alias); 13 Aug 2009 13:29:46 -0000 Received: (qmail 15212 invoked by uid 22791); 13 Aug 2009 13:29:44 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,J_CHICKENPOX_48,J_CHICKENPOX_56,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f214.google.com (HELO mail-bw0-f214.google.com) (209.85.218.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Aug 2009 13:29:36 +0000 Received: by bwz10 with SMTP id 10so588438bwz.29 for ; Thu, 13 Aug 2009 06:29:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.134.10 with SMTP id l10mr355221mun.52.1250170173313; Thu, 13 Aug 2009 06:29:33 -0700 (PDT) Date: Thu, 13 Aug 2009 14:56:00 -0000 Message-ID: Subject: Address as HImode when Pmode is QImode? From: Markus L To: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00219.txt.bz2 Hi, I am using gcc 4.4.1 and working on a port where #define BITS_PER_UNIT 16 #define UNITS_PER_WORD 1 #define Pmode QImode #define LONG_TYPE_SIZE 32 (i.e. int is 16 bits QImode, long is 32 bits HImode and pointer mode is QImode) POINTERS_EXTEND_UNSIGNED is not defined since POINTER_SIZE is equal to the width of Pmode trying to compile a simple function like int foo(int *a) { int i,s = 0; for (i = 0; i < 256; i++) s += a[i]; return s; } I run into an assert in convert_memory_address not beeing able to convert the address rtx (beeing HImode) into to Pmode (i.e. QImode). A few frames up the I can dump the tree node and it looks like the address calculations are done in HImode. Why is the address beeing calculated as unsigned long int and not as unsigned int which would be Pmode for my target? Is this expected (and my problem originates from elsewhere) or am I missing something obvious here? #3 0x0821c0a7 in expand_expr_real_1 (exp=0xb7d2b0a8, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../trunk/gcc-4.4.1/gcc/expr.c:7576 (gdb) call debug_tree(exp) unit size align 16 symtab 0 alias set 2 canonical type 0xb7cae2d8 precision 16 min max pointer_to_this > arg 1 unit size align 16 symtab 0 alias set -1 canonical type 0xb7cb51a0 precision 32 min max > arg 0 arg 0 /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> arg 1 arg 0 arg 0 arg 0 /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> arg 5 arg 0 used unsigned ignored QI file /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c line 21 col 11 size unit size align 16 context chain > /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> arg 6 addressable used file /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c line 17 col 5 context > /home/elamark/gcc/flexdsp_gcc/build_4.4.1/dotprod.c:21:5> (gdb) #0 fancy_abort (file=0x88f0014 "../../trunk/gcc-4.4.1/gcc/explow.c", line=326, function=0x88f0103 "convert_memory_address") at ../../trunk/gcc-4.4.1/gcc/diagnostic.c:712 #1 0x081f0e5a in convert_memory_address (to_mode=QImode, x=0xb7d293f0) at ../../trunk/gcc-4.4.1/gcc/explow.c:326 #2 0x081f0e7f in memory_address (mode=QImode, x=0xb7d293f0) at ../../trunk/gcc-4.4.1/gcc/explow.c:417 #3 0x0821c0a7 in expand_expr_real_1 (exp=0xb7d2b0a8, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../trunk/gcc-4.4.1/gcc/expr.c:7576 #4 0x0821952c in expand_expr_real (exp=0xb7d2b0a8, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../trunk/gcc-4.4.1/gcc/expr.c:7125 #5 0x0820674d in expand_expr (exp=0xb7d2b0a8, target=0x0, mode=VOIDmode, modifier=EXPAND_NORMAL) at ../../trunk/gcc-4.4.1/gcc/expr.h:539 #6 0x08218115 in expand_operands (exp0=0xb7d23058, exp1=0xb7d2b0a8, target=0x0, op0=0xbfbad064, op1=0xbfbad060, modifier=EXPAND_NORMAL) at ../../trunk/gcc-4.4.1/gcc/expr.c:6735 #7 0x0822688c in expand_expr_real_1 (exp=0xb7d2a60c, target=0xb7d29310, tmode=QImode, modifier=EXPAND_NORMAL, alt_rtl=0xbfbae8f0) at ../../trunk/gcc-4.4.1/gcc/expr.c:8498 #8 0x0821952c in expand_expr_real (exp=0xb7d2a60c, target=0xb7d29310, tmode=QImode, modifier=EXPAND_NORMAL, alt_rtl=0xbfbae8f0) at ../../trunk/gcc-4.4.1/gcc/expr.c:7125 #9 0x0820c363 in store_expr (exp=0xb7d2a60c, target=0xb7d29310, call_param_p=0, nontemporal=0 '\0') at ../../trunk/gcc-4.4.1/gcc/expr.c:4611 #10 0x0820ad93 in expand_assignment (to=0xb7d23058, from=0xb7d2a60c, nontemporal=0 '\0') at ../../trunk/gcc-4.4.1/gcc/expr.c:4395 #11 0x082310d1 in expand_expr_real_1 (exp=0xb7d2a630, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../trunk/gcc-4.4.1/gcc/expr.c:9234 #12 0x0821952c in expand_expr_real (exp=0xb7d2a630, target=0xb7ca42b8, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../trunk/gcc-4.4.1/gcc/expr.c:7125 #13 0x084a19e2 in expand_expr (exp=0xb7d2a630, target=0xb7ca42b8, mode=VOIDmode, modifier=EXPAND_NORMAL) at ../../trunk/gcc-4.4.1/gcc/expr.h:539 #14 0x084a3311 in expand_expr_stmt (exp=0xb7d2a630) at ../../trunk/gcc-4.4.1/gcc/stmt.c:1352 #15 0x0878cb6a in expand_gimple_basic_block (bb=0xb7c9aac8) at ../../trunk/gcc-4.4.1/gcc/cfgexpand.c:1979 #16 0x0878e199 in gimple_expand_cfg () at ../../trunk/gcc-4.4.1/gcc/cfgexpand.c:2382 #17 0x083e2ba6 in execute_one_pass (pass=0x8993ec0) at ../../trunk/gcc-4.4.1/gcc/passes.c:1280 #18 0x083e2ddc in execute_pass_list (pass=0x8993ec0) at ../../trunk/gcc-4.4.1/gcc/passes.c:1329 #19 0x08531811 in tree_rest_of_compilation (fndecl=0xb7d18400) at ../../trunk/gcc-4.4.1/gcc/tree-optimize.c:420 ... thanks and best regards /Markus