From patchwork Wed Feb 5 12:32:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Bolton X-Patchwork-Id: 316945 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 0820E2C0079 for ; Wed, 5 Feb 2014 23:46:07 +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=KH49Y8MOPF6i338S1pS+suf+d2/yDharwmQiLlGHOhHrunJINszq1 STDzQpguiHsli2SaWhgR//BvlRvbNhn5nVMn1JjP79ZIuZORho7BU0vxKIsuIaG/ 4wGED0D1NXt4QXUzEI3vxnLrkf+islMelIRFSN2osGvq4/NPvtNCxI= 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=IKnRlAUl+ucPybJSCp7HP+fszjA=; b=UYxxy6KCDoPsy7CURnem 5nMw3e9xpdLqBOBMmt4IEy3lmSiu9K3DFqSMcM/JDiB3yzz7zrcRz9mekti37uES 7ycQoCZqv/mPOPlMPnZOhmPGpwJHKYBjv+ymbHv1qB/mBbHTugQfvTOtF6fktREd wZ82M3ERT446wZYkE7BhNZg= Received: (qmail 26786 invoked by alias); 5 Feb 2014 12:46:01 -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 26777 invoked by uid 89); 5 Feb 2014 12:46:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, MSGID_MULTIPLE_AT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2014 12:45:59 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 05 Feb 2014 12:45:57 +0000 Received: from e104535vm ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 5 Feb 2014 12:32:53 +0000 From: "Ian Bolton" To: Subject: [PATCH] Make pr59597 test PIC-friendly Date: Wed, 5 Feb 2014 12:32:51 -0000 Message-ID: <000b01cf226e$62945930$27bd0b90$@bolton@arm.com> MIME-Version: 1.0 X-MC-Unique: 114020512455703601 X-IsSubscribed: yes PR59597 reinstated some code to cancel unnecessary jump threading, and brought with it a testcase to check that the cancelling happened. http://gcc.gnu.org/ml/gcc-patches/2014-01/msg01448.html With PIC enabled for arm and aarch64, the unnecessary jump threading already never took place, so there is nothing to cancel, leading the test case to fail. My suspicion is that similar issues will happen for other architectures too. This patch changes the called function to be static, so that jump threading and the resulting cancellation happen for PIC variants too. OK for stage 4 or wait for stage 1? Cheers, Ian 2014-02-05 Ian Bolton testsuite/ * gcc.dg/tree-ssa/pr59597.c: Make called function static so that expected outcome works for PIC variants too. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c index 814d299..bc9d730 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c @@ -8,7 +8,8 @@ typedef unsigned int u32; u32 f[NNN], t[NNN]; -u16 Calc_crc8(u8 data, u16 crc ) +static u16 +Calc_crc8 (u8 data, u16 crc) { u8 i=0,x16=0,carry=0; for (i = 0; i < 8; i++) @@ -31,7 +32,9 @@ u16 Calc_crc8(u8 data, u16 crc ) } return crc; } -int main (int argc, char argv[]) + +int +main (int argc, char argv[]) { int i, j; u16 crc; for (j = 0; j < 10000000; j++)