From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88759 invoked by alias); 26 Feb 2020 15:10:16 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 88750 invoked by uid 89); 26 Feb 2020 15:10:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,MISSING_HEADERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.1 spammy=logfiles, HContent-Transfer-Encoding:8bit X-HELO: ln01.mxout.alfaservers.com Received: from ln01.mxout.alfaservers.com (HELO ln01.mxout.alfaservers.com) (85.17.185.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Feb 2020 15:10:13 +0000 Received: from ip-83-134-99-52.dsl.scarlet.be ([83.134.99.52]:46812 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 1j6yKB-0000WR-F9 for gcc-help@gcc.gnu.org; Wed, 26 Feb 2020 16:10:11 +0100 Subject: Re: Question on gcc RTL and scheduling step. Cc: gcc-help@gcc.gnu.org References: <23414e8a-3b73-cbea-3acd-19460e954d77@blueice.be> <20200226125927.GM22482@gate.crashing.org> From: Henri Cloetens Message-ID: <86e3b82f-61a0-dc59-1511-5b0de7ae0866@blueice.be> Date: Wed, 26 Feb 2020 17:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20200226125927.GM22482@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00146.txt.bz2 Hello Segher, all, - On the issue of the restore of R18 in mode DI, it seems from   analysing the log file that the compiler does not understand this   also affects R19. This looks a bug to me ??. Anyway, I have resolved   this, by adding a 'clobber' statement to R19 when R18 is written   in mode 'DI'. - The other issue, I have changed ((set) (pc) (return)) to (return),   but, as far as I understand the logfiles, and the documentation,   both forms are equivalent. Anyway, after fixing the first issue, I do   not see the second issue any more. Best Regards and thanks, Henri. On 02/26/2020 01:59 PM, Segher Boessenkool wrote: > Hi! > > On Wed, Feb 26, 2020 at 01:02:46PM +0100, Henri Cloetens wrote: >> 1. The epilogue generator emits an instruction "popret_internal" that >>     a. Restores R18 in mode DI. (which corresponds to R18 and R19 in >> mode SI) >>     b. Does the function return. >> 2. Then, during scheduling, the compiler shifts an add instruction PAST >> this return >>     instruction, which is incorrect, because: >>    (a.) The instruction writes R19. (it restores R18 and R19). The >> scheduler should see this. > Yes. So why doesn't it? Look at the various dump files to see what the > df ("dataflow") framework thinks about this. > >>    (b.) The instruction changes the PC (program counter). > The documentation says you should write just > (return) > instead of > (set (pc) (return)) > (unlikely to be causing any of this, but a good cleanup to make). > >> Q. Why is this happening ?. How can I prevent this ?. > You can have the scheduler print much more debugging info, but I'd > start with the usual stuff: -dap. > > > Segher >