From patchwork Sun Jul 22 05:55:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 172477 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]) by ozlabs.org (Postfix) with SMTP id 4EE832C0120 for ; Sun, 22 Jul 2012 15:56:00 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343541361; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=fn6wtHh Tg8yyKZfW7e3H490w508=; b=BZu0frGZtmhmqpakjim6kj7zapGXk3V64ZYd7CH XZi1qdHhxkBcfVk8yVw92vuM47zuDC/WjIEAloGCjule4NLUh+dX3Ji0iwdU2W9g zfI7FvWyQ9JdLmfTiiLQMhFNC3iDbXy6u4Q1F69/5WoXDyL6BVybLpwvocA8VH3U Y5/U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IrQ0xw9lKJHutsmAAXmUp9jWr7NDaJhPxsxVXNOsRzNT08Mzan23kyKtd983fZ QufS4Gs6wwcoALuiID21KXs/MQLhZauxH7Ke7D2iYD6KGDqENjb6xfh7L5v+kjZ1 3p9zt+HhgJiBmd7Dv8wxBUdjIXhgjJ1aFWD/ry9uwvmfE=; Received: (qmail 26567 invoked by alias); 22 Jul 2012 05:55:55 -0000 Received: (qmail 26558 invoked by uid 22791); 22 Jul 2012 05:55:52 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_VM X-Spam-Check-By: sourceware.org Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jul 2012 05:55:36 +0000 Received: by wgbed3 with SMTP id ed3so4758027wgb.8 for ; Sat, 21 Jul 2012 22:55:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.231.208 with SMTP id l58mr5770689weq.138.1342936534937; Sat, 21 Jul 2012 22:55:34 -0700 (PDT) Received: by 10.216.229.136 with HTTP; Sat, 21 Jul 2012 22:55:34 -0700 (PDT) Date: Sat, 21 Jul 2012 22:55:34 -0700 Message-ID: Subject: [PATCH] Add a few more VRP IOR testcases From: Andrew Pinski To: GCC Patches X-IsSubscribed: yes 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 Hi, We (Cavium) has had these VRP testcases in our testsuite for a while and I found they pass without any patches. Committed as obvious after a test on x86_64-linux-gnu with no regressions. Thanks, Andrew Pinski 2012-07-21 Andrew Pinski * gcc.dg/tree-ssa/vrp72.c: New test. * gcc.dg/tree-ssa/vrp73.c: New test. * gcc.dg/tree-ssa/vrp74.c: New test. * gcc.dg/tree-ssa/vrp75.c: New test. Index: gcc.dg/tree-ssa/vrp72.c =================================================================== --- gcc.dg/tree-ssa/vrp72.c (revision 0) +++ gcc.dg/tree-ssa/vrp72.c (revision 0) @@ -0,0 +1,30 @@ +/* { dg-options "-O2" } */ + +typedef unsigned long long uint64_t; + +static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val) +{ + *(volatile uint64_t *)(long)addr = val; +}; +static inline uint64_t cvmx_read64_uint64(uint64_t addr) +{ + return *(volatile uint64_t *)(long)addr; +}; + +static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) +{ + cvmx_write64_uint64 (csr_addr, val); + if ((csr_addr >> 40) != 0x800118) + linker_error (); +} + +int uart; + +int +main () +{ + cvmx_write_csr (((((uint64_t) 2LL) << 62) + | (0x0001180000000808ull+((uart&0xff)*1024))), + 0xfff); + return 0; +} Index: gcc.dg/tree-ssa/vrp73.c =================================================================== --- gcc.dg/tree-ssa/vrp73.c (revision 0) +++ gcc.dg/tree-ssa/vrp73.c (revision 0) @@ -0,0 +1,30 @@ +/* { dg-options "-O2" } */ + +typedef unsigned long long uint64_t; + +static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val) +{ + *(volatile uint64_t *)(long)addr = val; +}; +static inline uint64_t cvmx_read64_uint64(uint64_t addr) +{ + return *(volatile uint64_t *)(long)addr; +}; + +static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) +{ + cvmx_write64_uint64 (csr_addr, val); + if ((csr_addr >> 40) == 0x800118) + linker_error (); +} + +int dest_core, src_core; + +int +main () +{ + cvmx_write_csr ((((((uint64_t)2LL) << 62) + | ((0x0001070000000600ull+((dest_core&0xff)*8))))), + 1ull << src_core); + return 0; +} Index: gcc.dg/tree-ssa/vrp74.c =================================================================== --- gcc.dg/tree-ssa/vrp74.c (revision 0) +++ gcc.dg/tree-ssa/vrp74.c (revision 0) @@ -0,0 +1,23 @@ +/* { dg-options "-O2" } */ + +void abort (void); +void exit (int); + +__attribute__ ((noinline)) void +f (unsigned long long i) +{ + if (i <= 0x1000000000000000ull) + { + unsigned long long j = i | 0x1000000000000000ull; + if (j == 0x1100000000000000ull) + exit (0); + } +} + +int +main () +{ + f (0x0100000000000000ull); + abort (); +} + Index: gcc.dg/tree-ssa/vrp75.c =================================================================== --- gcc.dg/tree-ssa/vrp75.c (revision 0) +++ gcc.dg/tree-ssa/vrp75.c (revision 0) @@ -0,0 +1,31 @@ +/* { dg-options "-O2" } */ + +typedef unsigned long long uint64_t; + +static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val) +{ + *(volatile uint64_t *)(long)addr = val; +}; +static inline uint64_t cvmx_read64_uint64(uint64_t addr) +{ + return *(volatile uint64_t *)(long)addr; +}; +static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) +{ + cvmx_write64_uint64 (csr_addr, val); + if ((csr_addr >> 40) != 0x800118) + linker_error (); +} + +int interface; +int idx; + +int +main () +{ + cvmx_write_csr((((((uint64_t) 2LL) << 62) + | ((0x0001180008000208ull + + (((idx)&3)*2048) + + (((interface)&1)*0x8000000ull))))), 1); + return 0; +}