From patchwork Thu Dec 27 14:59:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 1018922 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-493135-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kk3cwY+Q"; 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 43QY2N5n5Kz9s7h for ; Fri, 28 Dec 2018 02:01:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=YfqugeOtv9bhVMujCWW izKM7YLw9I7kI5N1KCR72/txKOOXc6Z/uO9PdCFGfXHSnj5MTC0qmQHLwWN7hpm0 3P0k9NQt4fUhNdFK0WYfOi8M2lhw8O30oRMq5rDqC7iwKbdxyJii7O4I9LgJ1SMP RhuMv6nTiUl/w5GOzWPAarkg= 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 :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; s=default; bh=fFzFE38ObzdL3R40aqFZG8xs+ Fw=; b=kk3cwY+Qux6vhgiFWMuVkL4Rsq1q2tyWB9S2sXD1dtykzVkltb3Wx3O/V uafXYCkobNucL5oLkJcCBH6sLDgOz/qfy8YISiYzeMPLp1QQ6FLF9pPF0j20LHv7 WYA0WKxHesu51b4J3mOG2p7OgybgYZ00O+joVdYrz8flyoPMmA= Received: (qmail 128384 invoked by alias); 27 Dec 2018 14:59:56 -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 128281 invoked by uid 89); 27 Dec 2018 14:59:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 14:59:54 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id DC3F012403FF; Thu, 27 Dec 2018 14:59:52 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH 8/8] c: Don't error for const or restrict as asm-qualifier Date: Thu, 27 Dec 2018 14:59:13 +0000 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes 2018-12-27 Segher Boessenkool c/ * c-parser.c (c_parser_asm_statement): Output a warning instead of an error for const and restrict. testsuite/ * gcc.dg/asm-qual-1.c: Adjust. --- gcc/c/c-parser.c | 2 +- gcc/testsuite/gcc.dg/asm-qual-1.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 4baad62..a960169 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -6345,7 +6345,7 @@ c_parser_asm_statement (c_parser *parser) case RID_CONST: case RID_RESTRICT: - error_at (loc, "%qE is not an asm qualifier", token->value); + warning_at (loc, 0, "%qE is not an asm qualifier", token->value); c_parser_consume_token (parser); continue; diff --git a/gcc/testsuite/gcc.dg/asm-qual-1.c b/gcc/testsuite/gcc.dg/asm-qual-1.c index eff6b45..4982a6b 100644 --- a/gcc/testsuite/gcc.dg/asm-qual-1.c +++ b/gcc/testsuite/gcc.dg/asm-qual-1.c @@ -8,7 +8,7 @@ f (void) { asm volatile (""); - asm const (""); /* { dg-error {'const' is not an asm qualifier} } */ + asm const (""); /* { dg-warning {'const' is not an asm qualifier} } */ - asm restrict (""); /* { dg-error {'restrict' is not an asm qualifier} } */ + asm restrict (""); /* { dg-warning {'restrict' is not an asm qualifier} } */ }