From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id A3081382E28A; Mon, 13 Jun 2022 10:42:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3081382E28A Received: by mail-qk1-x736.google.com with SMTP id n197so3713406qke.1; Mon, 13 Jun 2022 03:42:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YOjuauDbbUeGZHdMa9ujvw3qzVH0mrlGTRSWR9SSBSk=; b=NjTTGEPCRRMjUpCTvOQM/TA4DZpq0jcUBP3ThIYafeQ5Uv6JZ4jhAh2YRs12NxfzHT 6gd6Z/u7cWYdiTAJkFMw4PtvunOx9YRYZdd3xjEQbBlNAEYSEMGybHw9IwjZE9IU3qkC th9b1BfBJEuujUybscfX+zcISzTPFAz4FC5o70Y8O5ANo6DQdH6uU7uOUC5ZqEF/FfYK GL5+gqj1oNLMKq3tuw10bfLZT7WUEvz0BX3hjbOgU++i9tc3ZgnJ6VS1IPLDMejn7pkf TwE/X+xn6mLme1vmkDt9BDf/n2dE9inLufeyiN+jNWrBIEfjNTsiS9kht9G1C/DYRgwz 5xww== X-Gm-Message-State: AOAM530vVZ6Q2xQ5ijYWil6hC9vF93EsZ/IemmQhEiARQQDwLv/fehXA Ne7Pr2mjdCJylHwbTQMkwOjlDg9kkqPhtj4/9oY= X-Google-Smtp-Source: ABdhPJwHlEmcRWV3iI6flcYYUoPDto+Bts6R04LNRs5Bp78xwHMbphTWJYxMgEI+CYKaNLk4JSHk83mS31pVqkrxN3w= X-Received: by 2002:a05:620a:2489:b0:6a7:2540:93f with SMTP id i9-20020a05620a248900b006a72540093fmr14999065qkn.34.1655116951071; Mon, 13 Jun 2022 03:42:31 -0700 (PDT) MIME-Version: 1.0 References: <07f101d87b38$8c2b42a0$a481c7e0$@nextmovesoftware.com> <21519641.EfDdHjke4D@fomalhaut> In-Reply-To: <21519641.EfDdHjke4D@fomalhaut> From: Richard Biener Date: Mon, 13 Jun 2022 12:42:19 +0200 Message-ID: Subject: Re: [PATCH] PR middle-end/105874: Use EXPAND_MEMORY to fix ada bootstrap. To: Eric Botcazou Cc: Roger Sayle , GCC Patches , Tamar Christina Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 13 Jun 2022 10:42:33 -0000 On Wed, Jun 8, 2022 at 4:14 PM Eric Botcazou via Gcc-patches wrote: > > > The fix is to ensure that we call expand_expr with EXPAND_MEMORY > > when processing the VAR_DECL's returned by get_inner_reference. > > > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > > and make -k check (with no new failures), but also with > > --enable-languages="ada" where it allows the bootstrap to finish, > > and with no unexpected failures in the acats and gnat testsuites. > > Ok for mainline? > > Yes, thanks (modulo the nit in the ChangeLog). + /* If tem is a VAR_DECL, we need a memory reference. */ + enum expand_modifier tem_modifier = modifier; + if (tem_modifier == EXPAND_SUM) + tem_modifier = EXPAND_NORMAL; + if (TREE_CODE (tem) == VAR_DECL) + tem_modifier = EXPAND_MEMORY; that changes EXPAND_WRITE to EXPAND_MEMORY for VAR_DECL for example - what's 'modifier' in the problematic case? I do not understand how 'VAR_DECL' is special here btw. - it seems to be a condition making sure the new optimization doesn't trigger rather than a condition that will always require memory? Richard. > > 2022-06-08 Roger Sayle > > > > gcc/ChangeLog > > PR middle-end/105874 > > * gcc/expr.cc (expand_expr_real_1) : New local > > variable tem_modifier for calculating the expand_modifier enum to > > use for expanding tem. If tem is a VAR_DECL, use EXPAND_MEMORY. > > gcc/ prefix to be stripped > > -- > Eric Botcazou > >