From patchwork Wed Aug 24 06:14:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 662144 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 3sJxqx1Jygz9sDf for ; Wed, 24 Aug 2016 16:15:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Txqw+dnS; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=VeI2OKrM8o/6BxCeuLk76GIOs/9LCQgfQZ9MDVstfS+av1O5gy F0/yHL8PTcX+mu0MNdrekgjLS8Lk56cupbOQZ67VWfK679hu93DBA5yFcc+F7ujz UkRa7W3xvkynUjWHmQGAgBtXoHLm6rx6l2VCqqXITdGZzHuW/D5VK9KoY= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=mi8zcsjBjwCOUyhxNgWjjzvoSJ8=; b=Txqw+dnS5poYwBDSsRrt Q2uMP5P9z4jTYH+bV+GP1gRfUFy/jqfH0TsGFbCVobrmTv884fMiBuStxPLk/Ftz A1LK4h5771ZHXBxOrnKaMUgVeXyFGVv8K2AAlqLLYaI5N7epUO0ebgGZv4/IfYGZ GtOLG3byjokKqGDVKkzDyPo= Received: (qmail 61410 invoked by alias); 24 Aug 2016 06:15:17 -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 61399 invoked by uid 89); 24 Aug 2016 06:15:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Case, sk:TYPE_MA, sk:type_ma X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Aug 2016 06:15:06 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1bcRSq-0000Bk-Ck from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Tue, 23 Aug 2016 23:15:04 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 24 Aug 2016 07:15:02 +0100 To: GCC Patches From: Tom de Vries Subject: [PATCH, 3/4] Fix assert in build_va_arg, case 2b Message-ID: <21f9118f-c829-f6d0-0056-406d71c0b46f@mentor.com> Date: Wed, 24 Aug 2016 08:14:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Hi, this patch fixes an assert in build_va_arg. Instead of testing for pointer equality, we use the same test as is used in std_canonical_va_list_type. Bootstrapped and reg-tested on x86_64. OK for trunk? Thanks, - Tom Fix assert in build_va_arg, case 2b 2016-08-22 Tom de Vries * c-common.c (build_va_arg): Fix type comparison assert. --- gcc/c-family/c-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index a289d2b..3b61e64 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5894,7 +5894,10 @@ build_va_arg (location_t loc, tree expr, tree type) { /* Case 2b: va_list is pointer to array elem type. */ gcc_assert (POINTER_TYPE_P (va_type)); - gcc_assert (TREE_TYPE (va_type) == TREE_TYPE (canon_va_type)); + + /* Comparison as in std_canonical_va_list_type. */ + gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (va_type)) + == TYPE_MAIN_VARIANT (TREE_TYPE (canon_va_type))); /* Don't take the address. We've already got '&ap'. */ ;