From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ln01.mxout.alfaservers.com (ln01.mxout.alfaservers.com [85.17.185.57]) by sourceware.org (Postfix) with ESMTPS id D395A3985425 for ; Tue, 3 Nov 2020 12:59:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D395A3985425 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=blueice.be Authentication-Results: sourceware.org; spf=none smtp.mailfrom=henri.cloetens@blueice.be Received: from [193.121.150.145] (port=56030 helo=[192.168.178.60]) by ln01.alfaservers.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1kZvu2-0002rH-6o for gcc-help@gcc.gnu.org; Tue, 03 Nov 2020 13:59:10 +0100 To: gcc-help From: Henri Cloetens Subject: Issue with reload Message-ID: Date: Tue, 3 Nov 2020 14:00:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ln01.alfaservers.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - blueice.be X-Get-Message-Sender-Via: ln01.alfaservers.com: authenticated_id: henri.cloetens@blueice.be X-Authenticated-Sender: ln01.alfaservers.com: henri.cloetens@blueice.be X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 12:59:12 -0000 Hello All, I am working on a custom front-end, ran in an issue with reload. (step 277). The GCC version is 9.2.0 a. After expand, (step 234), I get: (insn 228 227 229 15 (set (reg:SI 186 [ x__lsm.224 ])         (zero_extend:SI (subreg:HI (reg:SI 378) 0))) "/home/henri/blueICe/gcc/newlib/newlib/libc/stdlib/ldtoa.c":784:5 43 {zero_extendhisi2_internal}      (nil)) b. The machine does have the instruction to do this. (zero_extendhisi2_internal). Here is the pattern description: (define_insn "zero_extendhisi2_internal"   [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")         (zero_extend:SI (match_operand:HI 1 "movhi_operand_0" "Z,C,r")))] c. Then the whole code runs through reload, and there it somewhere goes wrong.    The reloader changes the target register, and the operation gets distorted.    The subregging operation is gone !!.  583: r990:SI=zero_extend(r378:SI#0) d. This then leads further to error. The reloader restructures:  583: r990:SI=zero_extend(r1056:HI)     Inserting slow/invalid mem reload before:  1381: r1055:SI=[sfp:SI+0x2c]  1382: r1056:HI=r1055:SI#0 but the last operation (1382) is impossible. The reloader gets in an infinite loop, and crashes on max. number of reloads reached. Now, yes, obviously, I made a mistake .. But where to look ?. What did I do wrong the subreg got lost ?. Best Regards, Henri.