From patchwork Mon Dec 12 13:58:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Vyukov X-Patchwork-Id: 130753 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 A3EF91007D2 for ; Tue, 13 Dec 2011 00:58:28 +1100 (EST) Received: (qmail 20611 invoked by alias); 12 Dec 2011 13:58:26 -0000 Received: (qmail 20601 invoked by uid 22791); 12 Dec 2011 13:58:25 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-bw0-f73.google.com (HELO mail-bw0-f73.google.com) (209.85.214.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Dec 2011 13:58:11 +0000 Received: by bkbzv15 with SMTP id zv15so53181bkb.2 for ; Mon, 12 Dec 2011 05:58:10 -0800 (PST) Received: by 10.213.114.71 with SMTP id d7mr1168880ebq.5.1323698290139; Mon, 12 Dec 2011 05:58:10 -0800 (PST) Received: by 10.213.114.71 with SMTP id d7mr1168872ebq.5.1323698289977; Mon, 12 Dec 2011 05:58:09 -0800 (PST) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id q50si12950637eef.3.2011.12.12.05.58.09 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 12 Dec 2011 05:58:09 -0800 (PST) Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by hpza9.eem.corp.google.com (Postfix) with ESMTPS id A1B345C0063; Mon, 12 Dec 2011 05:58:09 -0800 (PST) Received: from 1024cores.msk.corp.google.com (1024cores.msk.corp.google.com [172.28.51.220]) by wpaz1.hot.corp.google.com with ESMTP id pBCDw7hV031719; Mon, 12 Dec 2011 05:58:07 -0800 Received: by 1024cores.msk.corp.google.com (Postfix, from userid 129372) id B25DAC30BC; Mon, 12 Dec 2011 17:58:06 +0400 (MSK) To: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org Subject: Fix compiler warnings in ThreadSanitizer tests (issue5483046) Message-Id: <20111212135806.B25DAC30BC@1024cores.msk.corp.google.com> Date: Mon, 12 Dec 2011 17:58:06 +0400 (MSK) From: dvyukov@google.com (Dmitriy Vyukov) X-System-Of-Record: true 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 This is for google-main branch. Fix compiler warnings in ThreadSanitizer tests. --- This patch is available for review at http://codereview.appspot.com/5483046 Index: gcc/testsuite/ChangeLog.google-main =================================================================== --- gcc/testsuite/ChangeLog.google-main (revision 182235) +++ gcc/testsuite/ChangeLog.google-main (working copy) @@ -1,3 +1,10 @@ +2011-12-12 Dmitry Vyukov + + * gcc.dg/tsan.h: Fix compiler warnings. + * gcc.dg/tsan-ignore.c: Fix compiler warnings. + * gcc.dg/tsan-ignore.h: Fix compiler warnings. + * gcc.dg/tsan-mop.c: Fix compiler warnings. + 2011-10-17 Dehao Chen * gcc.dg/record-gcc-switches-in-elf-1.c: New test. Index: gcc/testsuite/gcc.dg/tsan.h =================================================================== --- gcc/testsuite/gcc.dg/tsan.h (revision 182235) +++ gcc/testsuite/gcc.dg/tsan.h (working copy) @@ -15,7 +15,7 @@ __thread int mop_expect = 0; __thread int mop_depth = 0; __thread void* mop_addr = 0; -__thread unsigned long long mop_pc = 0; +__thread unsigned long mop_pc = 0; __thread unsigned mop_flags = 0; __thread unsigned mop_line = 0; @@ -40,15 +40,16 @@ { if (mop_expect) { - printf ("missed mop: addr=%p pc=%d line=%d\n", mop_addr, mop_pc, mop_line); + printf ("missed mop: addr=%p pc=%p line=%d\n", + mop_addr, (void*)mop_pc, mop_line); exit (1); } mop_expect = 1; mop_depth = depth; mop_addr = (void*)addr; - mop_pc = (unsigned long long)__builtin_return_address(0); - mop_flags = !!is_sblock | (!!is_store << 1) | ((size - 1) << 2); + mop_pc = (unsigned long)__builtin_return_address(0); + mop_flags = (!!is_sblock) | ((!!is_store) << 1) | ((size - 1) << 2); mop_line = line; } @@ -57,7 +58,7 @@ void __tsan_handle_mop (void *addr, unsigned flags) { - unsigned long long pc; + unsigned long pc; int depth; printf ("mop: addr=%p flags=%x called from %p line=%d\n", @@ -74,7 +75,7 @@ exit (1); } - pc = (unsigned long long)__builtin_return_address(0); + pc = (unsigned long)__builtin_return_address(0); if (pc < mop_pc - 100 || pc > mop_pc + 100) { printf ("incorrect mop pc: %p/%p line=%d\n", Index: gcc/testsuite/gcc.dg/tsan-ignore.c =================================================================== --- gcc/testsuite/gcc.dg/tsan-ignore.c (revision 182235) +++ gcc/testsuite/gcc.dg/tsan-ignore.c (working copy) @@ -5,28 +5,32 @@ /* Check ignore file handling. */ -int +void foo (int *p) { p [0] = 1; } -int bar (int *p) +void +bar (int *p) { p [0] = 1; } -int baz (int *p) +void +baz (int *p) { p [0] = 1; } -int bla (int *p) +void +bla (int *p) { p [0] = 1; } -int xxx (int *p) +void +xxx (int *p) { p [0] = 1; } Index: gcc/testsuite/gcc.dg/tsan-ignore.h =================================================================== --- gcc/testsuite/gcc.dg/tsan-ignore.h (revision 182235) +++ gcc/testsuite/gcc.dg/tsan-ignore.h (working copy) @@ -1,4 +1,4 @@ -int +void in_tsan_ignore_header (int *p) { p [0] = 1; Index: gcc/testsuite/gcc.dg/tsan-mop.c =================================================================== --- gcc/testsuite/gcc.dg/tsan-mop.c (revision 182235) +++ gcc/testsuite/gcc.dg/tsan-mop.c (working copy) @@ -28,7 +28,7 @@ __tsan_expect_mop(2, &p->x, 0, 1, sizeof(p->x), __LINE__); tmp = p->x; - + (void)tmp; } void testfor (P *p) @@ -54,6 +54,7 @@ __tsan_expect_mop(1, &p.x, 0, 1, sizeof(p.x), __LINE__); tmp = p.x; + (void)tmp; __tsan_expect_mop(1, &p.cp, 1, 1, sizeof(p.cp), __LINE__); p.cp = &p.c;