From patchwork Thu Jun 8 10:20:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 772946 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 3wk1fn6JJlz9s75 for ; Thu, 8 Jun 2017 20:21:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tmV/7ivO"; 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:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=WhqEDtM6U7ywSwZpWUdndSPIYI+F5iR/onIvCfSjwEXZj8JFgB z1X0zk59IVhpOxd5oGC5WZK1dC5H48WxepGQ1V5Ra3dsPRJF2zzD3zc8r3yPLa9F uA8U4fAr+KsmjbQroEcMccPfFBVlL6yovYzZwldBdxEGacNrPVkjvv+1M= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=kQ3b6TeeUz4GKIJ5O8tAD6C51Nc=; b=tmV/7ivONSMlW5NIcdgU HKuS2AUq/SXuOqIq01fPoHi+HpBL3YzUFKE9JujGd/gb4ZZuX1FR+MKw0hA3z/XC FHOXCd6o52r6QmkonaD+8AFys0SBt4PxrilkU8eXS9YgY08RkszP90GlzlvHKOC2 jsdYPP5hF4IwiEQq6RBM3aw= Received: (qmail 44475 invoked by alias); 8 Jun 2017 10:21:08 -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 44438 invoked by uid 89); 8 Jun 2017 10:21:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=suites, Hx-languages-length:3885, boards X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Jun 2017 10:21:04 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1dIuYp-000495-9u from Tom_deVries@mentor.com ; Thu, 08 Jun 2017 03:21:03 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 8 Jun 2017 11:20:57 +0100 To: GCC Patches CC: Rainer Orth , Mike Stump From: Tom de Vries Subject: [PATCH, testsuite] Fix no_trampolines test in check_effective_target_trampolines Message-ID: <09003684-3035-6eae-8b92-815afe4229b8@mentor.com> Date: Thu, 8 Jun 2017 12:20:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, Consider check_effective_target_trampolines: ... # Return 1 if according to target_info struct and explicit target list # target is supposed to support trampolines. proc check_effective_target_trampolines { } { if [target_info exists no_trampolines] { return 0 } if { [istarget avr-*-*] || [istarget msp430-*-*] || [istarget hppa2.0w-hp-hpux11.23] || [istarget hppa64-hp-hpux11.23] } { return 0; } return 1 } ... If I disable the nvptx target test in check_effective_target_trampolines and run tests for target nvptx, then the proc returns true instead of false, and I get 'UNSUPPORTED -> FAIL' changes for tests that require the effective target. This is due to the fact that https://github.com/MentorEmbedded/nvptx-tools/blob/master/nvptx-none-run.exp defines 'gcc,no_trampolines': ... set_board_info gcc,no_trampolines 1 ... but check_effective_target_trampolines tests no_trampolines (without the 'gcc,' in front): The effective target trampolines was introduced in 2008, but we've been testing 'gcc,no_trampolines' in gcc_target_compile since at least 1997. [ To complicate matters objc_target_compile tests for 'objc,no_trampolines' to set -DNO_TRAMPOLINES, but AFAICT that macro is not used anywhere in the objc test suites, so I think that's dead code. ] The original submission of the keyword is here ( https://gcc.gnu.org/ml/gcc-patches/2005-04/msg01925.html ) and uses 'target_info exists no_trampolines'. But in a follow-up comment ( https://gcc.gnu.org/ml/gcc-patches/2005-04/msg01978.html ) there is the suggestion to add 'set_board_info gcc,no_trampolines 1' to the board file to trigger the test in check_effective_target_trampolines. So that sounds like the missing 'gcc,' is accidental rather than intentional. In a further follow-up comment ( https://gcc.gnu.org/ml/gcc-patches/2005-04/msg02063.html ) Mike suggest to test for target triplets, which indeed was added in the next version. This probably explains why the missing 'gcc,' wasn't found in any further testing. As things are now, boards for targets that are not listed in check_effective_target_trampolines but still want the no_trampolines behavior need to do: - 'set_board_info gcc,no_trampolines 1' to trigger the test in gcc_target_compile and add -DNO_TRAMPOLINES to the flags - 'set_board_info no_trampolines 1' to trigger the test in check_effective_target_trampolines Given that: - it's better to have to define one variable than two - it looks like an accident that the 'gcc,' was dropped - the one with the 'gcc,' prefix has been around longer, and is mentioned in dejagnu docs I propose to test for 'gcc,no_trampolines' instead of 'no_trampolines' in check_effective_target_trampolines. I don't think a backward compatibility test for 'no_trampolines' is required, because the affected boardfiles most likely already define both. Tested by checking that the patch fixes the 'UNSUPPORTED -> FAIL' regression mentioned above for a single testcase. OK for trunk? Thanks, - Tom Fix no_trampolines test in check_effective_target_trampolines 2017-06-08 Tom de Vries * lib/target-supports.exp (check_effective_target_trampolines): Test for 'gcc,no_trampolines' instead of 'no_trampolines'. --- gcc/testsuite/lib/target-supports.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 8b99f35..d0b35be 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -491,7 +491,7 @@ proc check_gc_sections_available { } { # target is supposed to support trampolines. proc check_effective_target_trampolines { } { - if [target_info exists no_trampolines] { + if [target_info exists gcc,no_trampolines] { return 0 } if { [istarget avr-*-*]