From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id D507B3858D20 for ; Mon, 9 Jan 2023 13:05:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D507B3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x229.google.com with SMTP id f21so4372297ljc.7 for ; Mon, 09 Jan 2023 05:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=daoxt0UxK3HTwI6xf2IIJKUheKzwfaH1Bcc/v+7QVC8=; b=J8sZ+VwuXVr62TjdcnE5tmxd2cDP9bQvLVjxvnADZkKeEbvenxgwBSJIZPMCEhY7Jz ctqT7XKM2EKndDhYtr0ZWluAhhyETo8I3Q7CBsK2PVmZX0LWVePbLxYv4OqZ6fKklM1t TjkGK/zklA3anoVfjcLDgZxOJh4hgESyPV26hTQX+MKl/wnFcOcnLe+xwDZs+16dG2Hi COkcMtXXYmbKNJANg3FUK/tUK77JefhFP6pulEXWe0mu9/a2DOHCicBuolSKrlsKJdqm f6ksByinFm5A6MHQ355hLtQS9sr3cxCwf1fb4g1boPRHNof+DSBrU6Fkgotcj4TwiZWV scRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=daoxt0UxK3HTwI6xf2IIJKUheKzwfaH1Bcc/v+7QVC8=; b=BAMTHo9ozWZ1o9U2akzuOHXu81gcrOOcYopB1IR22w4j6Rj0toRj/e8KzYne8Fm+Hj Kto0xt+Ik/mUjZOSlgz1npf7Qyxl+NzKLyXeo1dA02+1PUQ56b7UQm2sSXr2XSOLbL+i sUH2jU92wL+742kKfkpB3BqVuWFsx8HKmXxZ+nCSD3EgRnGYiYYhn4NN3M6hNq6bFYkC /+DjvBp9a5Ol4A+w0ajdlI+9DLIB5rXBPS3HCCecQw8wepOWFYTgvUYZLSDPjSBSKDQm SUB/76yBHhXdTPkwIFhL3zx7XHc6mUALQxTEAOCd4YpeglT2DgIG0VDzEwbL49+FQlta Roug== X-Gm-Message-State: AFqh2kp8L8Lw9sDKp29TlVvBgUz8QmRbHTVtj3+CtTxDVSx+AOCOe+G4 qtItJCZ6bErYJAF+VfOuTJb8kdPDkaLuqU4C6qA= X-Google-Smtp-Source: AMrXdXuS/uKA5ZrMNh36/hyX8sql+lXrrsNjEadOXQfSzcjOqXzv+byuwERDgtp2heRRnv7/BrMgNs5WsZzIlwocSdI= X-Received: by 2002:a2e:a882:0:b0:280:51a:7297 with SMTP id m2-20020a2ea882000000b00280051a7297mr1165381ljq.49.1673269500358; Mon, 09 Jan 2023 05:05:00 -0800 (PST) MIME-Version: 1.0 References: <20221208105944.660323-1-jose.marchesi@oracle.com> <87y1rixd3n.fsf@oracle.com> <87cz8ttt88.fsf@oracle.com> <87zgaysmky.fsf@oracle.com> In-Reply-To: From: Richard Biener Date: Mon, 9 Jan 2023 14:04:48 +0100 Message-ID: Subject: Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization To: Jakub Jelinek Cc: "Jose E. Marchesi" , gcc-patches@gcc.gnu.org, david.faust@oracle.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Jan 9, 2023 at 10:58 AM Jakub Jelinek wrote: > > On Mon, Jan 09, 2023 at 09:05:26AM +0100, Richard Biener wrote: > > On Wed, Jan 4, 2023 at 9:54 AM Jose E. Marchesi via Gcc-patches > > wrote: > > > > > > > > > ping. > > > Would this be a good approach for fixing the issue? > > > > adding the is_libcall bit enlarges rtx_def by 8 bytes - there's no room for more > > bits here. > > That is obviously not the way to go, sure. > > > I really wonder how other targets avoid the issue you are pointing out? > > Do their assemblers prune unused (extern) .global? > > I think no target solves this, if they see an extern call during expansion > and emit some directive for those, they emit the global or whatever directive > which remains there. > > If all bits for CALL_INSN are taken, can't we add a flag on the CALL > rtx inside of the CALL_INSN pattern? Or a flag on the SYMBOL_REF inside of > it (libcalls are always direct calls, aren't they) or SYMBOL_REF_FLAGS ? I suppose the SYMBOL_REF would be what I'd target here. Note we already have /* 1 if RTX is a symbol_ref that has been the library function in emit_library_call. */ #define SYMBOL_REF_USED(RTX) \ (RTL_FLAG_CHECK1 ("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used) so can't we just use that during the final scan for the delayed assembling? > > Jakub >