From patchwork Mon Jul 25 12:00:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumar Selvaraj X-Patchwork-Id: 652242 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 3ryfx64pBqz9t1N for ; Mon, 25 Jul 2016 22:01:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=qvi4JmzF; 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:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=px99/bH7wpwhOS/EuBwwzrPuvy9meo7g9BQaKBdEjTY/doxZxpUCx UwgEhbmy+AfUzKAjuDnLYhmW/Wo931vZ7BN25pUsjs/217488mm6OS+n1GvYtRrM AYSC4nbwkeTxpK9/o5kMFkcw4XH6A4kh7/Mwl8BCVBq4sDDwqL1xWs= 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=e61M/n1pyw/24s32m2lhOl0wbtg=; b=qvi4JmzFpMs+v9yd5Kjr EK4dWugd3Y31QTIsuxaJF+fzFKgvVuVpkv2sx5EN+6s5+n2oMAGJtq4rdob9Rbhu 4OaqeQOEAeb2MKhUb8VT96gRSgNK2E/AVN7SG8MmLBPj8BPFGV23gFF1fSud5wc7 q5/iM9mGaQnNFRenEiDindk= Received: (qmail 125929 invoked by alias); 25 Jul 2016 12:01:23 -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 125833 invoked by uid 89); 25 Jul 2016 12:01:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_20, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:14.3.235, H*RU:14.3.235.1, H*r:ip*14.3.235.1, Hx-spam-relays-external:14.3.235.1 X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 25 Jul 2016 12:01:11 +0000 Received: from HNOCHT01.corp.atmel.com (10.161.30.161) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 25 Jul 2016 14:01:05 +0200 Received: from jaguar.atmel.com (10.161.30.18) by HNOCHT01.corp.atmel.com (10.161.30.161) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 25 Jul 2016 14:01:05 +0200 User-agent: mu4e 0.9.17; emacs 24.5.1 From: Senthil Kumar Selvaraj To: GCC Patches Subject: [Patch, testuite, committed] Fix some more tests that fail for non 32-bit int targets Date: Mon, 25 Jul 2016 17:30:34 +0530 Message-ID: <87zip6udul.fsf@atmel.com> MIME-Version: 1.0 X-IsSubscribed: yes Hi, The below patch fixes tests that fail for the avr target, because they assume ints are atleast 32 bits wide and pointers and longs have the same size. I've required int32plus support for one test, and for the other two, I've introduced a cast to intptr_t to avoid the pointer <-> int size difference warning. Reg tested on avr and x86_64 with no regressions. Committed as obvious. Regards Senthil gcc/testsuite/ChangeLog 2016-07-25 Senthil Kumar Selvaraj * gcc.dg/torture/pr69352.c (foo): Cast to intptr_t instead of long. * gcc.dg/torture/pr69771.c: Require int32plus. * gcc.dg/torture/pr71866.c (inb): Add cast to intptr_t. Index: gcc.dg/torture/pr69352.c =================================================================== --- gcc.dg/torture/pr69352.c (revision 238707) +++ gcc.dg/torture/pr69352.c (working copy) @@ -1,5 +1,7 @@ /* { dg-do compile } */ +#include + int a[10][14], b, c, d, e, f, g, h, i; void bar (void); int @@ -13,7 +15,7 @@ else m = 13; if (a[x][m]) - l = (long) foo; + l = (intptr_t) foo; a[x][i] = l; while (c) { Index: gcc.dg/torture/pr69771.c =================================================================== --- gcc.dg/torture/pr69771.c (revision 238707) +++ gcc.dg/torture/pr69771.c (working copy) @@ -1,5 +1,6 @@ /* PR rtl-optimization/69771 */ /* { dg-do compile } */ +/* { dg-require-effective-target int32plus } */ unsigned char a = 5, c; unsigned short b = 0; Index: gcc.dg/torture/pr71866.c =================================================================== --- gcc.dg/torture/pr71866.c (revision 238707) +++ gcc.dg/torture/pr71866.c (working copy) @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-additional-options "-ftree-pre -fcode-hoisting" } */ +#include typedef unsigned char u8; extern unsigned long pci_io_base; u8 in_8 (const volatile void *); @@ -25,7 +26,7 @@ static inline u8 inb (unsigned long port) { - return readb((volatile void *)pci_io_base + port); + return readb((volatile void *)(intptr_t)pci_io_base + port); } static inline void outb (u8 val, unsigned long port)