From patchwork Tue Jun 20 07:13:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 778142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wsJwq0PNJz9s7C for ; Tue, 20 Jun 2017 17:13:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="x9TPffmu"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=lY85oRpKIeuQDMPAJbhXg5v0tg3+S80upHOWO0PU+OR 0omKFtHI0a+cVFwbEy9lzEji89g/PFoKu+lfxxTJBM4vEan71LOcY19KNTtttHID CtXhPHFllIz9u82tnAydR+o3UJwhDW5s4TJPUR/9+fn10YyQCn2w1ppMBT1drd4A = 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:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=JmuyYuWlLfqPS6ZpS4YW8vrn3JY=; b=x9TPffmuUZdYSmPcM 4Lt16uvEtTADnTSb4LGwGEACA/C796oHV9zndmqMKXHfCjoF4TC92fIFgmC8IQiJ ajOV862DMonA8OayiVY0uho3jtD3UHRHzJ/EeCNYVc5POGwCls+9aPBij9G97wlF all8wdnDALXkuwz06tDsNcvAj8= Received: (qmail 67796 invoked by alias); 20 Jun 2017 07:13:32 -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 67778 invoked by uid 89); 20 Jun 2017 07:13:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1395 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Jun 2017 07:13:30 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8965AC060204 for ; Tue, 20 Jun 2017 07:13:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8965AC060204 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8965AC060204 Received: from tucnak.zalov.cz (ovpn-116-143.ams2.redhat.com [10.36.116.143]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3327F60318 for ; Tue, 20 Jun 2017 07:13:28 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v5K7DPfh007252 for ; Tue, 20 Jun 2017 09:13:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v5K7DPCS007251 for gcc-patches@gcc.gnu.org; Tue, 20 Jun 2017 09:13:25 +0200 Date: Tue, 20 Jun 2017 09:13:25 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Workaround buggy clang++ parser Message-ID: <20170620071325.GC2123@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! Apparently clang++ 3.2 and later (including current trunk, according to godbolt https://godbolt.org/g/ekDs6H ) has a bug in its C++ parser that it fails to properly parse the recent ubsan.h. I've committed a workaround for that as obvious, after bootstrapping/regtesting it on x86_64-linux and i686-linux. 2017-06-20 Jakub Jelinek PR sanitizer/81125 * ubsan.h (ubsan_encode_value): Workaround buggy clang++ parser by removing enum keyword. (ubsan_type_descriptor): Likewise. Formatting fix. Jakub --- gcc/ubsan.h.jj 2017-06-19 22:56:36.000000000 +0200 +++ gcc/ubsan.h 2017-06-20 00:31:16.714978973 +0200 @@ -55,8 +55,9 @@ extern bool ubsan_expand_objsize_ifn (gi extern bool ubsan_expand_vptr_ifn (gimple_stmt_iterator *); extern bool ubsan_instrument_unreachable (gimple_stmt_iterator *); extern tree ubsan_create_data (const char *, int, const location_t *, ...); -extern tree ubsan_type_descriptor (tree, enum ubsan_print_style = UBSAN_PRINT_NORMAL); -extern tree ubsan_encode_value (tree, enum ubsan_encode_value_phase +extern tree ubsan_type_descriptor (tree, ubsan_print_style + = UBSAN_PRINT_NORMAL); +extern tree ubsan_encode_value (tree, ubsan_encode_value_phase = UBSAN_ENCODE_VALUE_GENERIC); extern bool is_ubsan_builtin_p (tree); extern tree ubsan_build_overflow_builtin (tree_code, location_t, tree, tree,