From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by sourceware.org (Postfix) with ESMTPS id 43F9F3858D20 for ; Tue, 23 Jan 2024 06:44:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43F9F3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 43F9F3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705992281; cv=none; b=bSs7Yp3vIGiDm0v3e75oIGIXnV1EHaaNY0yOsnzR7vCBjmpwO76rjsQh3vpqjGZDO/eV9xZohcJ4/pTEnVYhsHILSfvtR89PX8l1aghAxCmgIT3n8gqEylsbD6fZVX+qu9F3FlFcjolQdvrOy9+1qsPw8P6+PcNBKNXdqj3m544= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705992281; c=relaxed/simple; bh=qElxfzHjIR4fZmFoNQfDKrj5YtI74pqXfrhAXiuPI0A=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iT025a0fPU1bhhTsqm4Gcqk41EvbmTrOrQf7gIRZTgk8k+KYeAuSohT7q/RbwDqnZsjYC7q/CDPYAag+P+w4PA7+THCTDSbNSpdMgz3GDKfkMi+jKoHITMtBEyT5dWJTfnmgrmS0cFWF80us4VG3hnJz0tS0ByogBqdfeM9GeJw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705992280; x=1737528280; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qElxfzHjIR4fZmFoNQfDKrj5YtI74pqXfrhAXiuPI0A=; b=c+ih+m17Mw5QIYwptTnXa6CnDsjR6OlRmU80q02nGcKmYx/l/chL4f+U D8ApJs1P1+PTDGxr+g9HrmakJFdJtOtPjMOHyYd5VtnnRbNZdoN5LRxR4 JX9v/HyGFxCD+xtXak+DokrvDdRINgobBXkiT56C/+Je4RuCmQrlylPZ5 da1j/6qHJvAT2zVOdki9dPNMsm0ZYrz7PZ7nfAsIXUHcn730ODy7qAV6K o7K2Ytg18G74v7+eFdmQ1Pgi5h+DOyyQuygh/W8jqR2Arh1ETNDdE0hAo Zd83Y1VkTM6mT5qWltVIMb4LTKF4KGXyMDi+auI8NNz8KTbDhbRNO91uF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="8103215" X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="8103215" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 22:44:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="1486204" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orviesa003.jf.intel.com with ESMTP; 22 Jan 2024 22:44:38 -0800 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 57F4910056FA; Tue, 23 Jan 2024 14:44:36 +0800 (CST) From: liuhongt To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com Subject: [PATCH 2/2] [x86] Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress. Date: Tue, 23 Jan 2024 14:42:36 +0800 Message-Id: <20240123064236.1827190-2-hongtao.liu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240123064236.1827190-1-hongtao.liu@intel.com> References: <20240123064236.1827190-1-hongtao.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Ready push to trunk. gcc/ChangeLog: * config/i386/i386-options.cc (ix86_option_override_internal): Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress. --- gcc/config/i386/i386-options.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index b6f634e9a32..e66a58ed926 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -2189,6 +2189,15 @@ ix86_option_override_internal (bool main_args_p, && opts->x_ix86_abi != DEFAULT_ABI) error ("%<-mabi=%s%> not supported with %<-fsanitize=thread%>", abi_name); + /* Hwasan is supported with lam_u57 only. */ + if (opts->x_flag_sanitize & SANITIZE_HWADDRESS) + { + if (ix86_lam_type == lam_u48) + warning (0, "%<-mlam=u48%> is not compatible with Hardware-assisted " + "AddressSanitizer, override to %<-mlam=u57%>"); + ix86_lam_type = lam_u57; + } + /* For targets using ms ABI enable ms-extensions, if not explicit turned off. For non-ms ABI we turn off this option. */ -- 2.31.1