From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by sourceware.org (Postfix) with ESMTPS id 5B9503857BB1 for ; Thu, 30 Nov 2023 12:00:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B9503857BB1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B9503857BB1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701345606; cv=none; b=vyJfF7TutD/NWxERT46gVxVOwwU4XCfYSUmh4tr/hfDUL0GEcxnZH/63YJf1qmcu5jT4AZxjb6W+Q6DlbOezhVU6YRIRlTeRr1YxXUnoBTkt6JqJGo5T7AaRo+Cs4WMMOfnYPeTZsXXCDehcdcD8AeDfyBZhpO9MhqIU/11otWk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701345606; c=relaxed/simple; bh=a7owc5SYtlnNQO5k9FXwcL/zvcRvAIeGkGNJY08ackM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=A4kfRDJoTq1250TLGkeDkLPRliolIPxF1YafQ9uRP+RsjC4RVj4vXbPJ1VvMysSywZrszXafYIO5BbGNd0T3ozxmIEX295TcVNn+jSgYD7Nzc6mil0I/xttdmphKVotaL7yAEfBWNhdiN8rJe51ksSQezpkMz14zI/tIrNGX+sA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50bc39dcbcbso1232127e87.1 for ; Thu, 30 Nov 2023 04:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701345603; x=1701950403; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WXp2+tPk5ThUAMDUHyOtVXx2+UMFCRdxXltn4IdDYkA=; b=IAFkaP5iMYMNlHh1bEzVAuLAtzqtINf5xS3jryUfPR8dA9cw/BYBPICgo+y/EEDUcW lJIuH3PW2g/jgROOWINSQHP6wF8ZB6B6N+RP9BhmfPya6tnXnPOeTjhykVnMaSd1DnPA A9dD3mmcdGtsZnMOhi0skX4S7ya7y4DU4bBn2boiGJO8njyJx1EfXyGYLU3S32GA57NN RjLq1YFlilga4e95XTDrw+mtAWfbaQosyCQziOgUA8uysdX9bscl43XczCJE4MAUsxG0 lI2sstsdY2EdExri52ZNRZlgkTfxO4ZsHlq1j2ozLXmOdCjtJH68IAOYxpTyjd+r161Y 5K0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701345603; x=1701950403; h=content-transfer-encoding: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=WXp2+tPk5ThUAMDUHyOtVXx2+UMFCRdxXltn4IdDYkA=; b=thdwxmGbq/baQRiBgYwaBZ0X8f0F/vRmUBg0DAjrKXbSMw2gUPJQ8ZOfUXmLeryEvQ /f4iaN6KDaIeKMrNHpd53spBAiTpVP1IXHPHY8bXAq+3KPYmx3dfoYRmYzQoTbqR0Qeb yI59UEl4cjyef/NkPuWev2jGUNXw/yO/T3oORm6tGzrqhJ3FP1wq8DanFUgAHQGiQfqY BCy5ieYxzT8EDMYngDFSF8FENCwnZyVi8lC3OkFvDiOUHzC3xw16t7X7rKKLdehUyH6U KPOP7JeKovAM2KZeETXbfnaGnyDRcRgBFgTR1AILf8CPnmmFHF+CjAhZ1oO26me80SJ0 eJsw== X-Gm-Message-State: AOJu0YxUerLIlUmHCm3rhbcrBD4162+WSy7ikmDUKptWhWa/xpi8ezE8 xaymZCpKLCzxtTo+/FhQ98RUTur+ySSTL9tVWrg= X-Google-Smtp-Source: AGHT+IGbSfod8j693rDmB/ZZOWZnA8LMmrtgHXo32kEKfBXacsTMBFZU6Qgq8NeZsl6+nAzmFx/OgXUYJVHSTSuGBiU= X-Received: by 2002:a05:6512:3d0f:b0:50a:6793:6954 with SMTP id d15-20020a0565123d0f00b0050a67936954mr19039944lfv.9.1701345602390; Thu, 30 Nov 2023 04:00:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Thu, 30 Nov 2023 12:56:11 +0100 Message-ID: Subject: Re: [PATCH v4] Introduce strub: machine-independent stack scrubbing To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, Jeremy Bennett , Craig Blackmore , Graham Markall , Martin Jambor , Jan Hubicka , Jim Wilson , Jeff Law , Jakub Jelinek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING autolearn=ham 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 Thu, Nov 30, 2023 at 6:04=E2=80=AFAM Alexandre Oliva = wrote: > > On Nov 29, 2023, Richard Biener wrote: > > > On Wed, Nov 29, 2023 at 9:53=E2=80=AFAM Alexandre Oliva wrote: > > >> Because &arg_#(D)[n_#] is good gimple, but &(*byref_arg_#(D))[n_#] isn= 't. > > > 'arg_#(D)' looks like a SSA name, and no, taking the address doesn't wo= rk, > > so I assume it was &MEM[arg_(D)][n_#] which is indeed OK. But you > > shouldn't need to change a pointer argument to be passed by reference, > > do you? As said, you want to restrict by-reference passing to argument= s > > that are !is_gimple_reg_type (). Everywhere where a plain PARM_DECL > > was valid a *ptr indirection is as well. > > > Can you check on the pass-by-reference thing again please? > > Applying the following patchlet on top of refs/users/aoliva/heads/strub > (that has a -fstrub=3Dall patchlet in it) I get a build error in libgo > building golang.org/x/mod/sumdb.o: > > In function =E2=80=98golang_0org_1x_1mod_1sumdb.Client.checkTrees.strub.0= =E2=80=99: > go1: error: invalid argument to gimple call > &older_195(D)->Hash > # VUSE <.MEM_55> > _16 =3D __builtin_memcmp (&h, &older_195(D)->Hash, 32); > during IPA pass: strub > > golang.org/x/mod/sumdb.go.057i.remove_symbols: _5 =3D __builtin_memcmp (= &h, &older.Hash, 32); Ah, yeah - &older.Hash is considered a constant while &older_195(D)->Hash i= sn't. So indeed you are correct - you'll need adjustments, sorry for misleading you ... Richard. > within golang_0org_1x_1mod_1sumdb.Client.checkTrees becomes, in wrapped > version thereof: > > golang.org/x/mod/sumdb.go.058i.strub: _16 =3D __builtin_memcmp (&h, &old= er_195(D)->Hash, 32); > > It's not even the case that Hash is at offset 0 into older's type, but I > suspect the reason why the former is well-formed while the latter is not > the offset, but the SSA_NAME. > > > diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc > index 293bec132b8..515ab9a2ee5 100644 > --- a/gcc/ipa-strub.cc > +++ b/gcc/ipa-strub.cc > @@ -1950,7 +1950,7 @@ walk_regimplify_addr_expr (tree *op, int *rec, void= *arg) > if (!*op || TREE_CODE (*op) !=3D ADDR_EXPR) > return NULL_TREE; > > - if (!is_gimple_val (*op)) > + if (0 && !is_gimple_val (*op)) > { > tree ret =3D force_gimple_operand_gsi (&gsi, *op, true, > NULL_TREE, true, GSI_SAME_STMT= ); > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive