From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id BDDFA3858038 for ; Mon, 4 Jan 2021 21:23:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BDDFA3858038 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-zNEPCvZ4P6KcCP33wXx4Sg-1; Mon, 04 Jan 2021 16:23:24 -0500 X-MC-Unique: zNEPCvZ4P6KcCP33wXx4Sg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BAD4C1005513; Mon, 4 Jan 2021 21:23:23 +0000 (UTC) Received: from localhost.localdomain (ovpn-114-95.phx2.redhat.com [10.3.114.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7691310016FB; Mon, 4 Jan 2021 21:23:23 +0000 (UTC) Subject: Re: [PATCH] Restore input_location after recursive expand_call_inline To: Bernd Edlinger , "gcc-patches@gcc.gnu.org" , Richard Biener References: From: Jeff Law Message-ID: <1d7f3f93-17c9-af16-504e-f32496c7107f@redhat.com> Date: Mon, 4 Jan 2021 14:23:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2021 21:23:27 -0000 On 1/4/21 1:12 PM, Bernd Edlinger wrote: > Hi, > > I spotted a place where input_location is clobbered accidentally. > > That is in a recursive call to expand_call_inline. The input_location > is usually restored by goto egress in this function. > > Additionally the return value of the recursive expand call is thrown > away, which does not look like a good idea. > > Although this causes no problems ATM, I wanted to fix it anyway. > > > Bootstrapped and reg-tested on x86_64-pc-linux-gnu. > Is it OK for trunk? > > > Thanks > Bernd. > > 0001-Restore-input_location-after-recursive-expand_call_i.patch > > From 88b963bba7b32972abf0ea44a01c03d643d7c6ca Mon Sep 17 00:00:00 2001 > From: Bernd Edlinger > Date: Mon, 4 Jan 2021 11:35:31 +0100 > Subject: [PATCH] Restore input_location after recursive expand_call_inline > > This is just a precautionary fix. > > 2021-01-04 Bernd Edlinger > > * tree-inline.c (expand_call_inline): Restore input_location. > Return result from recursive call. I suspect that we're always supposed to inline in this case.  As asserting that successfully_inlined is true before jumping to "egress" seems wise. OK with that change after the usual testing. Jeff