From patchwork Wed Dec 18 10:09:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 302755 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 EA5032C0091 for ; Wed, 18 Dec 2013 21:12:05 +1100 (EST) 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=lvpdVgK8hOmSaml0fw3LCK7xDYrkZ9NzbrGDtPTyB60xPMmNEdqVw ci4xcm9tcZIL7X/JzwZBnE6iLjZdLjP8E5ABh4P0zqo8zhXRgl0bklq85ZM009UB sXQanPBsn4H3vBXQrEhjQ2yHyvwS74w3dFSNQebawoav2AymkD/Xu4= 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:subject:date:message-id:mime-version:content-type; s= default; bh=fS+HuWZuhGLP8EMh7QSupBafXjo=; b=nK7G8A3hEiuPUqVUEwFI aHiGY6WJl0jkGAlk8sLS63Lib7qNi6VceWW5ILXSCIQp1HKHxIctTTkreu/DMOta pJ65gJI6TuOUXM6v4cl+kcvUqymhx+qn/Of/KdqL/gCibbppAR3gfSbY5oVy3eqF +vczIDic4btZ6LJwnEqZQx8= Received: (qmail 18985 invoked by alias); 18 Dec 2013 10:11:57 -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 18974 invoked by uid 89); 18 Dec 2013 10:11:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 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; Wed, 18 Dec 2013 10:11:56 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBIABsAp022970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Dec 2013 05:11:55 -0500 Received: from Cadeux.redhat.com (vpn1-7-138.ams2.redhat.com [10.36.7.138]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBIABqFX032687 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 18 Dec 2013 05:11:54 -0500 From: Nick Clifton To: gcc-patches@gcc.gnu.org Subject: RFA: Fix test pr32912-2.c for 16-bit targets Date: Wed, 18 Dec 2013 10:09:11 +0000 Message-ID: <87d2kufp2w.fsf@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes Hi Guys, The test gcc/testsuite/gcc.dg/pr32912-2.c fails to execute correctly on targets that use 16-bit integers, because it assumes at least a 32-bit integer. The patch below removes this assumption, and it also tidies up the code slightly so that __SIZEOF_INT__ is only tested in one place, not three. There were no regressions when tested with a i686-pc-linux-gnu or a x86_64-pc-linux-gnu toolchain, and the test was fixed for a rl78-elf toolchain. OK to apply ? Cheers Nick gcc/testsuite/ChangeLog 2013-12-18 Nick Clifton * gcc.dg/pr32912-2.c: Fix for 16-bit targets. Index: gcc/testsuite/gcc.dg/pr32912-2.c =================================================================== --- gcc/testsuite/gcc.dg/pr32912-2.c (revision 206082) +++ gcc/testsuite/gcc.dg/pr32912-2.c (working copy) @@ -1,14 +1,24 @@ /* { dg-do run } */ /* { dg-options "-O2 -w" } */ -/* { dg-skip-if "TImode not supported" { "avr-*-*" } { "*" } { "" } } */ extern void abort (void); #if(__SIZEOF_INT__ >= 4) -typedef int __m128i __attribute__ ((__vector_size__ (16))); +# define TYPE int +# define TYPED(a) a + +#elif(__SIZEOF_INT__ > 2) +# define TYPE long +# define TYPED(a) a##L + #else -typedef long __m128i __attribute__ ((__vector_size__ (16))); +# define TYPE long long +# define TYPED(a) a##LL #endif + + +typedef TYPE __m128i __attribute__ ((__vector_size__ (16))); + __m128i foo (void) { @@ -26,11 +36,7 @@ int main (void) { -#if(__SIZEOF_INT__ >= 4) - union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u, v; -#else - union { __m128i v; long i[sizeof (__m128i) / sizeof (long)]; } u, v; -#endif + union { __m128i v; TYPE i[sizeof (__m128i) / sizeof (TYPE)]; } u, v; int i; u.v = foo (); @@ -39,9 +45,10 @@ { if (u.i[i] != ~v.i[i]) abort (); + if (i < 3) { - if (u.i[i] != (0x11111111 << i)) + if (u.i[i] != (TYPED (0x11111111) << i)) abort (); } else if (u.i[i])