From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 8BAE93858433 for ; Tue, 5 Dec 2023 06:26:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BAE93858433 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 8BAE93858433 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701757591; cv=none; b=OlPVgb/B4tGnS4mZxz230pm3a4RfWKMxATWEEknP0CZnGlYlExu8Q+HeqUX6uRv9DVdS0w6sUnCK9+R7C53hZyQAxjAtAVpjbYDaMcTWKerHfbY/Wg/qaGsZZB1E3Yu5KPB1gMvd3I55/PqNQtRp3SKko3pSIH++fOIQKtsR7Bo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701757591; c=relaxed/simple; bh=oZKn0oWVM1KPQaFPbVcsAWy+FmvZbTep2kpH1wjTR9U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uB2aU0DfwaaQ8FDbkqZ1LcEUKRJ0jfHWqwm0fswMN5GaCNxPUBsK3pwoEFx2kFKdeakN/HNludvzewUOuENDHlZomY4heCnevGsIF2qWo3H9iIaF8PGwDyelpBMm+GjYPgm9i9qhydD4q7x0wzOC1+ms949vaUR9GrJTQF5iCeY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6ce3efb78e2so2440238b3a.1 for ; Mon, 04 Dec 2023 22:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1701757580; x=1702362380; darn=gcc.gnu.org; h=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=2Fzp1fRO9CRcLlNnxlDjwF3wFMxPlBGHxBuLKUYV86Y=; b=fuYdtIQTRZ5W9dQ4yxRpiULQmxYarkDm1Bfp7rKYPgKqHEkIag33FI1NUPmJbMBEfB dCoBMWPyuZTuWRUf4ySmq2aAcpX3ZN2KXbGW0KImVCWncooI7yp4TR8B87b5OCEjCR9H SV7BG1TMSGWImJkQ0pRT1VrTNajgN8nre13FJ4+kyG2scwoVHD01YAtvpU25ruQbZKFp fWYztVb4y8XRBOwWE2+lDnUoKTYCV6zSRTDI3AKSST624g1UsG2OEhOc0jAQx/S81eCf kMlzKrS7c13pj1M9U4OjBgbIZxo0DxNcNWg4B1BUfjLWiklxvaYx7rbrx6Xix8Cj1dnL uCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701757580; x=1702362380; h=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=2Fzp1fRO9CRcLlNnxlDjwF3wFMxPlBGHxBuLKUYV86Y=; b=PuYvewwJhapalO64sbvAauco+HcN809xonFHG4GI6V4U1j0xmtm8e/ZjRhXfdYw0cE b5bo2hKJtr9HaGJHDWwzal4SWT2Qyy3wNnX8zFuuY4TArMpDWh7n5nPa+Es8bFAF1ykn e9GXCrIPCxMS7oHRGRxsnv8gV/WxMMqDa7NY9x71SClma03AdWe18/rHJqHctWaEUlK2 jnvExy4R3ZYlo51U1K1rH7NhSkdrck0gRidZ9a7CszPiN7Uiz507mvUctkKBl84CQuFJ R06PjqI4/FX7IJntH9pLM11EUM+sZRNfr/31tOHMgfSnIrNjuENQoo8vdWAjkR/7wppp A4BQ== X-Gm-Message-State: AOJu0YzEVJYR/xg/ZmcXiYPDSOFl59XyBjPHxCuxIH/pQ2z47XmNPK9q aGf28eUua7NAHLvSCWfQRYXyMg== X-Google-Smtp-Source: AGHT+IGsV1EtStUS9wdHbGouG4CSZY2yHCEyR+egIvSnQP2oj3ilbeVZvcUlhsDiV9h2q44G18RWqg== X-Received: by 2002:a05:6a00:3693:b0:6ce:6f21:566c with SMTP id dw19-20020a056a00369300b006ce6f21566cmr437706pfb.7.1701757580457; Mon, 04 Dec 2023 22:26:20 -0800 (PST) Received: from free.home ([2804:7f1:2080:a85f:bd63:28af:c09e:3bce]) by smtp.gmail.com with ESMTPSA id z17-20020aa78891000000b006ce566685b1sm2326478pfe.65.2023.12.04.22.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 22:26:19 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3B56Pxrp209278 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 5 Dec 2023 03:26:00 -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 v5] Introduce strub: machine-independent stack scrubbing Organization: Free thinker, does not speak for AdaCore References: Date: Tue, 05 Dec 2023 03:25:59 -0300 In-Reply-To: (Alexandre Oliva's message of "Sat, 02 Dec 2023 14:56:03 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: The recently-installed patch for interprocedural value-range propagation enabled some folding that was not expected by the strub-const testcases, causing them to fail. I'm making the following adjustments to them to restore the behavior they tested for, and to make them more future-proof to future improvements of ivrp. I intend to install this as part of the monster patch upthread. --- a/gcc/testsuite/c-c++-common/torture/strub-const1.c +++ b/gcc/testsuite/c-c++-common/torture/strub-const1.c @@ -1,18 +1,22 @@ /* { dg-do compile } */ /* { dg-options "-fstrub=strict -fdump-ipa-strub" } */ -/* Check that, along with a strub const function call, we issue an asm statement - to make sure the watermark passed to it is held in memory before the call, - and another to make sure it is not assumed to be unchanged. */ +/* Check that, along with a strub const function call, we issue an asm + statement to make sure the watermark passed to it is held in memory before + the call, and another to make sure it is not assumed to be unchanged. f + should not be inlined into g, but if it were too simple it might be folded + by interprocedural value-range propagation. */ + +extern int __attribute__ ((__strub__ ("callable"), __const__)) c (); int __attribute__ ((__strub__, __const__)) -f() { - return 0; +f () { + return c (); } int -g() { - return f(); +g () { + return f (); } /* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */ --- a/gcc/testsuite/c-c++-common/torture/strub-const2.c +++ b/gcc/testsuite/c-c++-common/torture/strub-const2.c @@ -6,17 +6,19 @@ before the call, and another to make sure it is not assumed to be unchanged. */ +extern int __attribute__ ((__strub__ ("callable"), __const__)) c (); + int __attribute__ ((__strub__)) #if ! __OPTIMIZE__ __attribute__ ((__const__)) #endif -f() { - return 0; +f () { + return c (); } int -g() { - return f(); +g () { + return f (); } /* { dg-final { scan-ipa-dump-times "__asm__" 2 "strub" } } */ -- 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