From patchwork Thu May 2 15:11:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1094348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-500002-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="nuNvZL+n"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44vzHP3PMCz9s9G for ; Fri, 3 May 2019 01:11:13 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=XsyJZrE8vK3ep7PLXFs2CUstn1OKs7us/vho4yJLbGHToqEV2S Cd1oZt4lXoBWno4Zukf7oAae6QP4Rie6QFM+CM4AEBLn45Cr4YkVFbXQ/QtnbMyS +YXLT8bDzMShXE0jF9PegVLahRU2CnHzSjhpolCYgwIYctmmdisYZCC18= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=y/4DJQ34BmBEqPBsev0dw4nCd90=; b=nuNvZL+nBfn1vyqQ1KWM MQJkfD/2YlE9b49ZtDiYcpKfjS7OObFygE4Ja8E0jvxXI84rhG0cBOItNWTSBxMp T84AzC52PBX5OSQisV/D5e3HhuZQhyyB4mCKrMO5gUdpFTGfiPjmvMGU83OW9oxG MvFzTtEgSqHGHgAN98hQXn8= Received: (qmail 103121 invoked by alias); 2 May 2019 15:11:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 103110 invoked by uid 89); 2 May 2019 15:11:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 May 2019 15:11:04 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6A18DAD47; Thu, 2 May 2019 15:11:02 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Error only when -mabi=ms is used on a non-MS_ABI system (PR sanitizer/90312). To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek Message-ID: <7d58226c-a152-c561-66cd-96503b700e8d@suse.cz> Date: Thu, 2 May 2019 17:11:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi. As mentioned in the PR, we should not provide an error on mingw and cygwin targets. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: 2019-05-02 Martin Liska PR sanitizer/90312 * config/i386/i386.c (ix86_option_override_internal): Error only when DEFAULT_ABI != MS_ABI. gcc/testsuite/ChangeLog: 2019-05-02 Martin Liska PR sanitizer/90312 * gcc.dg/asan/pr87930.c: Run the test only on *linux or *gnu systems. * gcc.dg/tsan/pr88017.c: Likewise. --- gcc/config/i386/i386.c | 11 ++++++++--- gcc/testsuite/gcc.dg/asan/pr87930.c | 2 +- gcc/testsuite/gcc.dg/tsan/pr88017.c | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bc2348c3bc7..ad6357fab2c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3706,11 +3706,16 @@ ix86_option_override_internal (bool main_args_p, error ("%<-mabi=ms%> not supported with X32 ABI"); gcc_assert (opts->x_ix86_abi == SYSV_ABI || opts->x_ix86_abi == MS_ABI); - if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS) && opts->x_ix86_abi == MS_ABI) + if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS) + && opts->x_ix86_abi == MS_ABI + && DEFAULT_ABI != MS_ABI) error ("%<-mabi=ms%> not supported with %<-fsanitize=address%>"); - if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) && opts->x_ix86_abi == MS_ABI) + if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) + && opts->x_ix86_abi == MS_ABI + && DEFAULT_ABI != MS_ABI) error ("%<-mabi=ms%> not supported with %<-fsanitize=kernel-address%>"); - if ((opts->x_flag_sanitize & SANITIZE_THREAD) && opts->x_ix86_abi == MS_ABI) + if ((opts->x_flag_sanitize & SANITIZE_THREAD) && opts->x_ix86_abi == MS_ABI + && DEFAULT_ABI != MS_ABI) error ("%<-mabi=ms%> not supported with %<-fsanitize=thread%>"); /* For targets using ms ABI enable ms-extensions, if not diff --git a/gcc/testsuite/gcc.dg/asan/pr87930.c b/gcc/testsuite/gcc.dg/asan/pr87930.c index 4f8e6999fde..5a65d3fb030 100644 --- a/gcc/testsuite/gcc.dg/asan/pr87930.c +++ b/gcc/testsuite/gcc.dg/asan/pr87930.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ +/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && lp64 } } } */ /* { dg-options "-fsanitize=address -mabi=ms" } */ int i; diff --git a/gcc/testsuite/gcc.dg/tsan/pr88017.c b/gcc/testsuite/gcc.dg/tsan/pr88017.c index 82693a67e87..10df2818b0d 100644 --- a/gcc/testsuite/gcc.dg/tsan/pr88017.c +++ b/gcc/testsuite/gcc.dg/tsan/pr88017.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ +/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && lp64 } } } */ /* { dg-options "-fsanitize=thread -mabi=ms" } */ int i;