From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6539 invoked by alias); 8 Jul 2011 13:21:23 -0000 Received: (qmail 6530 invoked by uid 22791); 8 Jul 2011 13:21:22 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_NUMERIC_HELO,SPF_HELO_PASS,TW_OV,TW_TM,TW_VH,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jul 2011 13:21:06 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QfAzQ-0003et-Ou for gcc@gcc.gnu.org; Fri, 08 Jul 2011 15:21:04 +0200 Received: from 193.128.72.68 ([193.128.72.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2011 15:21:04 +0200 Received: from pocmatos by 193.128.72.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2011 15:21:04 +0200 To: gcc@gcc.gnu.org From: "Paulo J. Matos" Subject: gcc 4.6.1 expand is playing tricks on me Date: Fri, 08 Jul 2011 13:21:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 X-IsSubscribed: yes 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: 2011-07/txt/msg00090.txt.bz2 Hi, I got a few size regressions when moving from 4.5.3 to 4.6.1, all due to the same issue. I have code that is basically a double word memory move: void simple1(uint32 *a, uint32 *b) { *a = *b; } GCC 4.6.1 is from this gimple: simple1 (uint32 * a, uint32 * b) { uint32 D.1927; # BLOCK 2 freq:10000 # PRED: ENTRY [100.0%] (fallthru,exec) D.1927_2 = *b_1(D); *a_3(D) = D.1927_2; return; # SUCC: EXIT [100.0%] } calling gen_movhi twice with: call1 : operand[0]: (reg:HI 19 [ D.1927 ]) operand[1]: (mem:HI (reg/v/f:QI 21 [ b ])) call2 : operand[0]: (mem:HI (reg/v/f:QI 20 [ a ])) operand[1]: (reg:HI 19 [ D.1927 ]) while GCC 4.5.3 for _exactly_ the same gimple (as far as it is shown in the logs) it only calls gen_movhi with: operand[0]: (mem:HI (reg/v/f:QI 20 [ a ])) operand[1]: (mem:HI (reg/v/f:QI 21 [ b ])) This seems to boil down to code that looks exactly the same between 4.5.3-4.6.1 in cfgexpand.c, expand_gimple_basic_block: def_operand_p def_p; def_p = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_DEF); if (def_p != NULL) { /* Ignore this stmt if it is in the list of replaceable expressions. */ if (SA.values && bitmap_bit_p (SA.values, SSA_NAME_VERSION (DEF_FROM_PTR (def_p)))) continue; } last = expand_gimple_stmt (stmt); maybe_dump_rtl_for_gimple_stmt (stmt, last); gcc4.5.3 hits continue the first time it gets there and gcc4.6.1 fails the inner if and enters expand_gimple_stmt twice. From the comment in ssaexpand.h for the definition of SA.values, it says: /* For an SSA name version V bit V is set iff TER decided that its definition should be forwarded. */ bitmap values; What is TER? Any hints on why GCC 4.6.1 has now a different behaviour to GCC 4.5.3? Cheers, -- Paulo Matos