From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id D59443896828 for ; Thu, 10 Jun 2021 06:44:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D59443896828 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 72C531FD37; Thu, 10 Jun 2021 06:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623307486; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MlrJDwYAPOjJLQBQr98NNob+JPJFKwCALGD0xG92Vvc=; b=hXUvngUfHK4wzjp5T0mb3gJoL0VfcdEY/NQmvJsKyG2ndkyCUBYbx1RUmGQb1OwneVewCc tTvemWLvj1oTqzFbHpXv90zs1rPe/YTl65TIEI4q8wH+UakmQYXlWiqecgKH+sErtZQunf dH1AE8gsQjK9fqAll9/Fm2Nhnnhx5+g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623307486; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MlrJDwYAPOjJLQBQr98NNob+JPJFKwCALGD0xG92Vvc=; b=sm0fxtRl2X/qY557P3AH6PMsmgAm8AXpcTbVbQj+NulWhXEYAviuQQyiMiUIax1cvVJr/0 JC3E4ltExRuOQVBA== Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 6DB40A3B87; Thu, 10 Jun 2021 06:44:46 +0000 (UTC) Date: Thu, 10 Jun 2021 08:44:46 +0200 (CEST) From: Richard Biener To: Eric Botcazou cc: Jakub Jelinek , gcc-patches@gcc.gnu.org Subject: Re: [patch] Reuse non-gimple_reg variable for inlining In-Reply-To: <7921630.T7Z3S40VBb@fomalhaut> Message-ID: References: <8762858.CDJkKcVGEf@fomalhaut> <20210609191002.GX7746@tucnak> <7921630.T7Z3S40VBb@fomalhaut> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Thu, 10 Jun 2021 06:44:49 -0000 On Wed, 9 Jun 2021, Eric Botcazou wrote: > > I'm afraid the inliner would need to prove the to be inlined callee doesn't > > modify its own copy of the variable too, because if it modifies it (at least > > in C/C++ const can be cast away), then this introduces wrong-code, see > > PR100994 for details. > > Then please remove the TREE_READONLY marker in C/C++ if this is a lie. I agree the cases are invalid C/C++ - this isn't casting away const qualification of a pointed to type but of an object and storing into a readonly object at least invokes undefined behavior. It might even be allowed to diagnose it as error. Richard.