From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 819F63858D37 for ; Thu, 30 Nov 2023 05:04:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 819F63858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 819F63858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701320681; cv=none; b=AxrDBz5NucCS5ymUWr948c8Lwb623vLCxeG877/Xb4jyzUh8MCUjpX5BKFvEpfBvhO0jYu3WCpTGeVtJ7JLAOrQWvVvb5ZixUK8AcunbzHXt6y9iK9aqOvp4aM7okrhUnrTx/Kd9szsWf7dpavQGfaI/J+m/TxVs+yu+GxT5Ibs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701320681; c=relaxed/simple; bh=9d6K2anY6fWtbMj+ZcnkXmuxgE0XXQqyNjFC28C5nlo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MPuFDDe7QFBAHYzl6URhlzfPR3edhlGPDBmnCnvesXhpEpQ6StFZiafDcsqvEHNauE9SGF/f9fEA0WBxXhPP2252qkUDEAfKAZXFc6ENdY0F/eM7cf2pOSJLLrVPLmMdmHyMxcMy/1kKRAVxabayiNeqavD/BlHHZ8if4D0i+bc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1cf7a8ab047so5384655ad.1 for ; Wed, 29 Nov 2023 21:04:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1701320678; x=1701925478; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ASQvaO+iHTLPooycnOlZ5uYoEPWAMlCeZxPFzaxSJoM=; b=GKkB8+JLW3T9yGtp70obwzzSBH0mOJROUX6R7EG9VMzyQwLjg0HUYHSpYoCtELGkP9 Ht0OBEEOrCBuVDunD9KXVlNsAioTaDMvsDPTck32pbZNFDrN98P45ZDeGKDJOGEHyQuv JKKVNcfImH6hKj6Vm+5IgwGSep8ClcN+PJsRQfYKydNMfnYkCrcVJMmR2CTfbSRP5YeR JetK4j3a3E9XxkcAKLC8Wl/0/5641JwnrZZh+hbXA2wAd5WA3/VwEm54zqw8ZL9uvPYu +Uh7GgfTuuUPmC476OGv9q2MIp550bjGhOph9jN/t480UChHsytFy7FmBER+di5M8o0Y /26A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701320678; x=1701925478; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ASQvaO+iHTLPooycnOlZ5uYoEPWAMlCeZxPFzaxSJoM=; b=AIKcsRDe5fJeJ1BlfW+8hUDfl88QPPGN1+0Ss6LVRpbnvms7DX2Sq2pGYI/J0JqEVS R42HL8yw4qpMYPYknjefi+jMfY4eRQvFOwFKAqoJC57OiQMxcMnwg9op6STw7cK67M3t 0B2GSflwFenS85kMSLNIkOUFmEWfvPA7a6Xijga3oT0K8vjViIAuN/e0QJd0nsXtLsz5 pPBn7mvyQCxg0ynb3JfX+OwkayPERYZEWxunyRPBxhj1PqL7hVm7Fp7ghSEuE/wLRh2G EybdW0rSFuHkoo4v4gQaCJ3//IDjB2Vu/dA+1Uw8SEaKf2ao3hozfv8R0ZpPjNl4J7Mv PSbA== X-Gm-Message-State: AOJu0YxEiyyprRhb6ElHBgk76ce6Qdv+KHqGjlLpah7T6HvY5kai7RsC DdsDfCG/suGJWbxnTsQcTonr1Q== X-Google-Smtp-Source: AGHT+IFdlblMI1+72fHWPMhxS+6O6Gd+ENhBbtncnEXcs+gCAyqem4Lnj1VtbZqDPxEYUHVc3EJoqQ== X-Received: by 2002:a17:903:454:b0:1ca:a07b:36d with SMTP id iw20-20020a170903045400b001caa07b036dmr21281168plb.48.1701320678492; Wed, 29 Nov 2023 21:04:38 -0800 (PST) Received: from free.home ([2804:7f1:2080:8d38:553a:9121:2785:9c36]) by smtp.gmail.com with ESMTPSA id jb1-20020a170903258100b001cfcd2fb7b0sm275335plb.285.2023.11.29.21.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 21:04:38 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3AU54ScC050129 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 30 Nov 2023 02:04:29 -0300 From: Alexandre Oliva To: Richard Biener Cc: gcc-patches@gcc.gnu.org, Jeremy Bennett , Craig Blackmore , Graham Markall , Martin Jambor , Jan Hubicka , Jim Wilson , Jeff Law , Jakub Jelinek Subject: Re: [PATCH v4] Introduce strub: machine-independent stack scrubbing Organization: Free thinker, does not speak for AdaCore References: Date: Thu, 30 Nov 2023 02:04:28 -0300 In-Reply-To: (Richard Biener's message of "Wed, 29 Nov 2023 13:48:41 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING autolearn=unavailable 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 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 work, > 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 arguments > 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); 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, &older= _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; =20 - 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); --=20 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