From patchwork Tue Jan 19 05:28:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Um9nZXIgRmVycmVyIEliw6HDsWV6?= X-Patchwork-Id: 569797 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 E0B2B1401E7 for ; Tue, 19 Jan 2016 16:28:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=O5qbbC9y; 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 :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=j5dy1l/rYbueTaTklb5UoCYNGj4B4SdNjdD6hwXyLOdys2 2ac3Hki5LGXULGtjV8vtNvsSg14ylDeAj1nfmWT0M04sF4yj5ZTbltGiW6mrWNpd 98XNOPAh4DgiCloJqem9Mhkt4Mv8f5LPMMcgoz6C26nxvSh/ENvl4LWEugJX0= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=DOZPyqAE5EbIXAPULltqnrXw0tA=; b=O5qbbC9yRhhB/PL1gOac V1BwiEuriLxUvfp3eJXCzNnkrdsnnTsXfU7giKt6q1yIQXRbeL6hBKfXdYPiZ+xk O6BOmDE363BlgILp8ohPchGWFDs9FSpKVuWalOWteyivN4CUuOSPvsEbXhHoTpkj 4RL/S1dbB1MGbBLCxgaAI34= Received: (qmail 23157 invoked by alias); 19 Jan 2016 05:28:35 -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 23041 invoked by uid 89); 19 Jan 2016 05:28:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:SET_TYP, sk:set_typ, type_name, sk:build_d X-HELO: mail-io0-f173.google.com Received: from mail-io0-f173.google.com (HELO mail-io0-f173.google.com) (209.85.223.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 19 Jan 2016 05:28:22 +0000 Received: by mail-io0-f173.google.com with SMTP id q21so570369223iod.0 for ; Mon, 18 Jan 2016 21:28:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=vCVDSfAtZ5PRlWCwk/fb/UpZ+5qxQpp12S8Xr0mEs1o=; b=c5b5iEy4j++iZb9W6NmaP62IFpzs09dX4hjGwKvOdTjLbg+q9CE+23/7vTjcdKMWwC jlgXPjqmuaNFUf3JQedYwIXEhnfgHrgiTZPsqC5Ukv6lk5ii5WoXj2fegB4RnNP7E09E 58H33hN1qITI8WNRqMcj7KSPOv+N+a1bmVqeP46E2+VC12Nr6JRNLtF6ORb23k0xStd5 B6ZWm7jPocxNXa35V1dKXg0z/UThBgllvZhhgEp7a2Uyyz7QtMho88GM+WWRQ9jAfQPz UBlylHA1r47bv7WzDCq7fMAWknQdaJlm/BTPPVuUpTmwXHZYQaHbPaN2d2ukLkEKKr1g ahkw== X-Gm-Message-State: ALoCoQmQJLC0K5xda9FRBgqCNCOkoQp29Ud3NB5PXlzNet/UPcWJBLt+85QZkTveQRZzwjvYFKU4R9BURFeqFg2rLNm7+8/G+A== MIME-Version: 1.0 X-Received: by 10.107.10.88 with SMTP id u85mr25106179ioi.5.1453181299094; Mon, 18 Jan 2016 21:28:19 -0800 (PST) Received: by 10.36.65.27 with HTTP; Mon, 18 Jan 2016 21:28:18 -0800 (PST) Date: Tue, 19 Jan 2016 06:28:18 +0100 Message-ID: Subject: [PATCH] Fix for PR67896 (C++ FE cannot distinguish __Poly{8, 16, 64, 128}_t types) From: =?UTF-8?B?Um9nZXIgRmVycmVyIEliw6HDsWV6?= To: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Hi, aarch64-builtins.c defines several SIMD builtin types. Among these SIMD types there are the polynomials __Poly{8,16,64,128}_t. These are built by a call to build_distinct_type_copy (unsigned_int{Q,H,D,T}I_type_node), respectively, i.e. they are not VECTOR_TYPEs. A later loop, traverses an array containing all the SIMD types and skips those types for which a VECTOR_TYPE does not have to be built: this is, types __Poly{8,16,64,128}_t. That same loop does SET_TYPE_STRUCTURAL_EQUALITY on the newly created vector type, but it does this unconditionally, thus setting TYPE_CANONICAL of types __Poly{8,16,64,128}_t to NULL. The net effect of this is that the C++ FE is unable to distinguish between all __Poly{8,16,64,128}_t and between vector types with the same number of elements but different polynomial type as element type (like __Poly8x8_t vs __Poly16x8_t). Note that sizeof (correctly) returns different values for all these types. This patch simply protects SET_TYPE_STRUCTURAL_EQUALITY inside the branch that creates the vector type. I have bootstrapped and regression tested this on a small board aarch64-unknown-linux-gnu host without new regressions. P.S.: I haven't signed the copyright assignment to the FSF. The change is really small but I can do the paperwork if required. Kind regards, gcc/ChangeLog: 2016-01-19 Roger Ferrer Ibáñez PR aarch64/67896 * aarch64-builtins.c (aarch64_init_simd_builtin_types): Do not set structural equality to __Poly{8,16,64,128}_t types gcc/testsuite/ChangeLog: 2016-01-19 Roger Ferrer Ibáñez PR aarch64/67896 * pr67896.C: New test From 22edde54bcc50fc41a8195d84d278bd1a1dfeb13 Mon Sep 17 00:00:00 2001 From: Roger Ferrer Ibanez Date: Thu, 14 Jan 2016 21:54:56 +0100 Subject: [PATCH] Do not mark polynomial types as requiring structural equality --- gcc/config/aarch64/aarch64-builtins.c | 8 +++++--- gcc/testsuite/gcc.target/aarch64/simd/pr67896.C | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/pr67896.C diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index bd7a8dd..edacf10 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -610,14 +610,16 @@ aarch64_init_simd_builtin_types (void) enum machine_mode mode = aarch64_simd_types[i].mode; if (aarch64_simd_types[i].itype == NULL) - aarch64_simd_types[i].itype = - build_distinct_type_copy + { + aarch64_simd_types[i].itype = + build_distinct_type_copy (build_vector_type (eltype, GET_MODE_NUNITS (mode))); + SET_TYPE_STRUCTURAL_EQUALITY (aarch64_simd_types[i].itype); + } tdecl = add_builtin_type (aarch64_simd_types[i].name, aarch64_simd_types[i].itype); TYPE_NAME (aarch64_simd_types[i].itype) = tdecl; - SET_TYPE_STRUCTURAL_EQUALITY (aarch64_simd_types[i].itype); } #define AARCH64_BUILD_SIGNED_TYPE(mode) \ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/pr67896.C b/gcc/testsuite/gcc.target/aarch64/simd/pr67896.C new file mode 100644 index 0000000..1f916e0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/pr67896.C @@ -0,0 +1,7 @@ +typedef __Poly8_t A; +typedef __Poly16_t A; /* { dg-error "conflicting declaration" } */ +typedef __Poly64_t A; /* { dg-error "conflicting declaration" } */ +typedef __Poly128_t A; /* { dg-error "conflicting declaration" } */ + +typedef __Poly8x8_t B; +typedef __Poly16x8_t B; /* { dg-error "conflicting declaration" } */ -- 2.1.4