From patchwork Tue May 30 08:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 100663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2028123vqr; Tue, 30 May 2023 01:43:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZJGrpZaNzdh+9x7oEkMv+RVJGbzPerFX1b2ovCs327jN0Mvv8A1vOaSz+5T/tllY2Ux3B X-Received: by 2002:a17:907:868e:b0:94f:3521:396 with SMTP id qa14-20020a170907868e00b0094f35210396mr1916134ejc.23.1685436198868; Tue, 30 May 2023 01:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685436198; cv=none; d=google.com; s=arc-20160816; b=fcroDZh6ujoCRkAoh4muhS5PGwNVMnipfJUiRYnA+lcWYfsoHomOprwkMmbMyzUwnc GDWd4kc5JIxwLFtgUiqflehB78p89vMITuT1m/nGSuJc54qCxHpoNH8+Kd8uZZmbFQEm OMVJUnzNuvUfIObYEbTFaozIj+SiMf6QxsAdeEvYmyKxWrfuPeD34d/xFJmd3bH4pWTP ZmTRxAZuX5wPntJim3dFIL1pJLMStsBSqMhLDphPWTyVdKub+m5DxzvUHUf7V58IXjfu gjkKGrQAcfaP7TlQspLZ4EBf1LfT1GgAhl5t7heMZ01VF+GxeSJHI+rA6w2yasjuEVb9 1Ghg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=aA1Ru7F3wInj5gYWXv5Q5TRHob7sut86wKJzumwtrhk=; b=yI0U8ff5K5XtGvyYDlkUbVNWG9IuAL8B6jn9d3d215u0EUmQgqF7Qh0BgCmPFtljKd zyBY0B9avthLq772f+Gggdtw66OUXd4Wvk2bAddP3OParXGj0qKJy7mSJcmYE57Gh0UB w3YLRafCNJdyxnme9/ZdY1aQkgR7GlvXjw5ul2Ob56A9vAPew4P0vXaKXsxYdnRmj41X W7PUIlLNeov00yJgwcbfWt7oCDQeOcmMFz1sZ53zr42D0mY8IqoVZBZtPRoH2d6sBm16 RT1IFrQSbccV7fW+DAdlKsLhBXuX7RBSVYJWa5MCqJXA97rosmTjqAYcMBSr4Yv+A6s7 0njQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XQorNvlf; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z26-20020a1709063ada00b0096a97134296si194523ejd.721.2023.05.30.01.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 01:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XQorNvlf; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5D8B3857704 for ; Tue, 30 May 2023 08:43:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5D8B3857704 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685436197; bh=aA1Ru7F3wInj5gYWXv5Q5TRHob7sut86wKJzumwtrhk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XQorNvlfRgt1oADWjU5fvw39Fz2jbDz77LVAmGz0DBAmY/GxQ1AiXwZDYQdeKDLle je1FKJmWeNG7HTtOsWr6vomdYerfZKn0my8Hdu5uGs3lYHaeXvOioIY1dvkyu3AukS Goyb9cyjcPmlgLEqhppwl/oKIUsiUT3fyVncNImc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id D47713858D20 for ; Tue, 30 May 2023 08:42:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D47713858D20 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 04C0C21A40 for ; Tue, 30 May 2023 08:42:33 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id ED6B22C141 for ; Tue, 30 May 2023 08:42:32 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id CA8D64A04CE; Tue, 30 May 2023 10:42:32 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] riscv: update riscv_asan_shadow_offset X-Yow: ONE: I will donate my entire ``BABY HUEY'' comic book collection to the downtown PLASMA CENTER.. TWO: I won't START a BAND called ``KHADAFY & THE HIT SQUAD''.. THREE: I won't ever TUMBLE DRY my FOX TERRIER again!! Date: Tue, 30 May 2023 10:42:32 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK 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-Patchwork-Original-From: Andreas Schwab via Gcc-patches From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767307947488070911?= X-GMAIL-MSGID: =?utf-8?q?1767307947488070911?= This fixes all asan tests, apart from c-c++-common/asan/pointer-compare-1.c which needs a workaround for PR sanitizer/82501. PR target/110036 * config/riscv/riscv.cc (riscv_asan_shadow_offset): Update to match libsanitizer. --- gcc/config/riscv/riscv.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 09fc9e5d95e..b358ca8b5d0 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -7043,10 +7043,9 @@ riscv_asan_shadow_offset (void) { /* We only have libsanitizer support for RV64 at present. - This number must match kRiscv*_ShadowOffset* in the file - libsanitizer/asan/asan_mapping.h which is currently 1<<29 for rv64, - even though 1<<36 makes more sense. */ - return TARGET_64BIT ? (HOST_WIDE_INT_1 << 29) : 0; + This number must match ASAN_SHADOW_OFFSET_CONST in the file + libsanitizer/asan/asan_mapping.h. */ + return TARGET_64BIT ? HOST_WIDE_INT_UC (0xd55550000) : 0; } /* Implement TARGET_MANGLE_TYPE. */