From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id AFEEE385AE6D for ; Wed, 29 Jun 2022 12:04:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AFEEE385AE6D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7C20C1F9C4 for ; Wed, 29 Jun 2022 12:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1656504285; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U4Dbnvpahl4vrPMRvCQt/TEc+hWE65RFewxiqt+sdxw=; b=L9LOq/5uKnh7f8VT6Hv099M4Gd8b0nSEXvqGw5Cj26tKCUKkvo3DPK7eyMWlwO0oMmQOVv nCpnf+a56Idm+N5TJhhIbZgfTHgRjobKqgJ+Nq3addg0GeSkCV/xk8DCGbskDy/HkZ3LmJ TWh92kMlrnglzpt5pTliBrzYQvHhokk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1656504285; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U4Dbnvpahl4vrPMRvCQt/TEc+hWE65RFewxiqt+sdxw=; b=epyDU4YNJ69N6O/NXBbne4SpC7CMDaYSInETYkk4fGEDwIJ1vJ0flJjkTkDl1KHCIy9750 R5nofP14uUzgPHAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6F75B133D1 for ; Wed, 29 Jun 2022 12:04:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HzlOGt0/vGJaSgAAMHmgww (envelope-from ) for ; Wed, 29 Jun 2022 12:04:45 +0000 Message-ID: Date: Wed, 29 Jun 2022 14:04:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] sanitizer: Fix hwasan related option conflicts [PR106132] To: gcc-patches@gcc.gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 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 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-List-Received-Date: Wed, 29 Jun 2022 12:04:48 -0000 Split report_conflicting_sanitizer_options(..., SANITIZE_ADDRESS | SANITIZE_HWADDRESS) call into 2 calls as we don't have any option that would be address+hwaddress (that conflicts as well). PR sanitizer/106132 gcc/ChangeLog: * opts.cc (finish_options): Use 2 calls to report_conflicting_sanitizer_options. gcc/testsuite/ChangeLog: * c-c++-common/hwasan/arguments-3.c: Cover new ICE. --- gcc/opts.cc | 4 +++- gcc/testsuite/c-c++-common/hwasan/arguments-3.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/opts.cc b/gcc/opts.cc index fe0293e4283..54e57f36755 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -1214,7 +1214,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, /* Address sanitizers conflict with the thread sanitizer. */ report_conflicting_sanitizer_options (opts, loc, SANITIZE_THREAD, - SANITIZE_ADDRESS | SANITIZE_HWADDRESS); + SANITIZE_ADDRESS); + report_conflicting_sanitizer_options (opts, loc, SANITIZE_THREAD, + SANITIZE_HWADDRESS); /* The leak sanitizer conflicts with the thread sanitizer. */ report_conflicting_sanitizer_options (opts, loc, SANITIZE_LEAK, SANITIZE_THREAD); diff --git a/gcc/testsuite/c-c++-common/hwasan/arguments-3.c b/gcc/testsuite/c-c++-common/hwasan/arguments-3.c index 6e907b46b3b..2bf8917355b 100644 --- a/gcc/testsuite/c-c++-common/hwasan/arguments-3.c +++ b/gcc/testsuite/c-c++-common/hwasan/arguments-3.c @@ -1,3 +1,5 @@ /* { dg-do compile } */ -/* { dg-additional-options "-fsanitize=thread" } */ +/* { dg-additional-options "-fsanitize=thread,address" } */ +/* { dg-error ".*'-fsanitize=thread' is incompatible with '-fsanitize=address'.*" "" { target *-*-* } 0 } */ /* { dg-error ".*'-fsanitize=thread' is incompatible with '-fsanitize=hwaddress'.*" "" { target *-*-* } 0 } */ +/* { dg-error ".*'-fsanitize=hwaddress' is incompatible with '-fsanitize=address'.*" "" { target *-*-* } 0 } */ -- 2.36.1