From patchwork Wed Apr 11 13:52:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 897190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476214-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mips.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mqQcUi82"; dkim-atps=neutral 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 40LlrD1mcTz9s3B for ; Wed, 11 Apr 2018 23:53:48 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=i3VcyNVBiHzcV3cv QxEcpIL0Lb5Ldqw8LvRm0gZ9iyiv21UG5PWSd4aNIcWtMlWkBkL6yKIGQ7EunD3w eReimqUznarjHZ6QtIaCKKtcnTOjb14LKT6xHDwfEb6zBSAn0bqYJCFhctYoGoTV 9Lu8C+4dxFJsxAr3nZ1rc4jIIg8= 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:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=4vCsT0wfCBOXEI26ljYexD 5CEtU=; b=mqQcUi82Z5nwiTExNI+8sLv1B+tZYJRQclqV/GOGspAIjLSxexe2S3 f3vD0ugrF7hoEFiAEFWj/RUXXfOClqAXWAemwb3pJkzLNz+twkdu0sufXX8dieyI 4yVY5zDo2V1t9NSHBuY7DB4J4uXEEe2fADKViKzL0rgdDUvHyTTD4= Received: (qmail 52679 invoked by alias); 11 Apr 2018 13:53:41 -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 52666 invoked by uid 89); 11 Apr 2018 13:53:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.2 spammy=revealed X-HELO: 9pmail.ess.barracuda.com Received: from 9pmail.ess.barracuda.com (HELO 9pmail.ess.barracuda.com) (64.235.154.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Apr 2018 13:53:39 +0000 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1403.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Wed, 11 Apr 2018 13:53:31 +0000 Received: from [10.20.78.219] (10.20.78.219) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 11 Apr 2018 06:53:45 -0700 Date: Wed, 11 Apr 2018 14:52:15 +0100 From: "Maciej W. Rozycki" To: Catherine Moore , Matthew Fortune CC: Paul Hua , Subject: [PATCH 1/2] MIPS/GCC/testsuite: Fix data-sym-pool.c for SVR4 model at -O0 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-ClientProxiedBy: mipsdag02.mipstec.com (10.20.40.47) To mipsdag02.mipstec.com (10.20.40.47) X-BESS-ID: 1523454811-321459-4418-800-1 X-BESS-VER: 2018.4-r1804052328 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191879 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 With GCC configurations using the SVR4 rather than the PLT dynamic executable model and the o32 ABI with the data-sym-pool.c test case code like below is produced: .file 1 "data-sym-pool.c" .section .mdebug.abi32 .previous .nan legacy .module fp=xx .module nooddspreg .abicalls .text .align 2 .globl frob .set mips16 .set nomicromips .ent frob .type frob, @function frob: .frame $17,8,$31 # vars= 0, regs= 1/0, args= 0, gp= 0 .mask 0x00020000,-4 .fmask 0x00000000,0 save 8,$17 move $17,$sp lw $2,$L4 move $sp,$17 restore 8,$17 jr $31 .type __pool_frob_3, @object __pool_frob_3: .align 2 $L3: .word __gnu_local_gp $L4: .word 305419896 .type __pend_frob_3, @function __pend_frob_3: .insn .end frob .size frob, .-frob .ident "GCC: (GNU) 8.0.1 20180410 (experimental)" causing a failure due to the unexpected `__gnu_local_gp' entry in the constant pool, even though there is nothing wrong with it as far as the annotation being examined is concerned. Given that the SVR4 vs PLT code model consideration is irrelevant for this test case rather than rewriting the regular expression to match this variant of code just enforce the PLT model by using the `-mplt' option. It is safe to use this option unconditionally as it is silently ignored with configurations that do not support this model, e.g. bare metal ELF. gcc/testsuite/ * gcc.target/mips/data-sym-pool.c (dg-options): Add `-mplt'. --- Hi, I have regression-tested this with the `mips-mti-linux-gnu' target and the o32, n32 and n64 ABIs. The two latters are demoted to o64 by the test framework due to the lack of MIPS16 support for the hard-float variants of these ABIs and I don't have soft-float multilibs configured, so instead I have verified n32/soft-float and n64/soft-float variants by hand. The latter revealed the need for 2/2. Finally I do not have a bare metal ELF configuration available for regression-testing right now, so I only verified that `-mplt' is silently ignored. Code generated is expected to be the same as in the PLT mode. OK to apply? Maciej --- gcc/testsuite/gcc.target/mips/data-sym-pool.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) gcc-mips16-test-data-sym-pool-extra-entries.diff Index: gcc/gcc/testsuite/gcc.target/mips/data-sym-pool.c =================================================================== --- gcc.orig/gcc/testsuite/gcc.target/mips/data-sym-pool.c 2016-11-17 21:24:46.000000000 +0000 +++ gcc/gcc/testsuite/gcc.target/mips/data-sym-pool.c 2018-04-10 23:27:49.226719338 +0100 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mips16 -mcode-readable=yes" } */ +/* { dg-options "-mips16 -mcode-readable=yes -mplt" } */ int frob (void) @@ -20,6 +20,10 @@ $L3: # The label must match. __pend_frob_3: # The symbol must match. .insn - that is `__pool_*'/`__pend_*' symbols inserted around a constant pool. */ + that is `__pool_*'/`__pend_*' symbols inserted around a constant pool. + + This code is built with `-mplt' to prevent the special `__gnu_local_gp' + symbol from being placed in the constant pool at `-O0' for SVR4 code + and consequently interfering with test expectations. */ /* { dg-final { scan-assembler "\tlw\t\\\$\[0-9\]+,(.L(\[0-9\]+))\n.*\t\\.type\t(__pool_frob_\\2), @object\n\\3:\n\t\\.align\t2\n\\1:\n\t\\.word\t305419896\n\t\\.type\t(__pend_frob_\\2), @function\n\\4:\n\t\\.insn\n" } } */ From patchwork Wed Apr 11 13:52:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 897191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476215-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mips.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rMSkh9ih"; dkim-atps=neutral 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 40Lls95XLBz9s1j for ; Wed, 11 Apr 2018 23:54:37 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=NjjQYTtLW1EqHp7t 9mAB4KRJ5HGI242u6qFRB5NMkwb1Jgvjsmh0gux0ZNy6vp5mzuFyAOSaFv1pcTfU NmMFpCRLqQG4cXruufSzdisA0z+c4hz72XDdotsfVCY2uRZDH1d9HzvDzuLOfdIS f6awsRI/tRJZguz3/PFU42ucC4g= 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:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=r+znTahmGyAlB+hxaaxkzz nZAGM=; b=rMSkh9ihO6kuIpTsmz8GAzMXSS8kVgXKLhPF5ul7TiQbrHaANqmoZb jgaSsAT3kLiPzYehRvlKco7wMwRZ3g7ZUIOEn0g4aFxYfkQHfaidyKn5lULE8q5x nhwfd9jZG9n2KBrtrV5R5v3PuXqlEtnsFF8GQWKSbbzebmW+D910w= Received: (qmail 69645 invoked by alias); 11 Apr 2018 13:54:30 -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 69300 invoked by uid 89); 11 Apr 2018 13:54:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=mat X-HELO: 9pmail.ess.barracuda.com Received: from 9pmail.ess.barracuda.com (HELO 9pmail.ess.barracuda.com) (64.235.154.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Apr 2018 13:54:28 +0000 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1403.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Wed, 11 Apr 2018 13:54:23 +0000 Received: from [10.20.78.219] (10.20.78.219) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Wed, 11 Apr 2018 06:54:27 -0700 Date: Wed, 11 Apr 2018 14:52:58 +0100 From: "Maciej W. Rozycki" To: Catherine Moore , Matthew Fortune CC: Paul Hua , Subject: [PATCH 2/2] MIPS/GCC/testsuite: Fix data-sym-pool.c for n64 code In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-ClientProxiedBy: mipsdag02.mipstec.com (10.20.40.47) To mipsdag02.mipstec.com (10.20.40.47) X-BESS-ID: 1523454852-321459-4411-860-2 X-BESS-VER: 2018.4-r1804052328 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191879 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 With the soft-float n64 ABI and the data-sym-pool.c test case code like below is produced: .file 1 "data-sym-pool.c" .section .mdebug.abi64 .previous .nan legacy .module softfloat .module oddspreg .abicalls .option pic0 .text .align 2 .globl frob .set mips16 .set nomicromips .ent frob .type frob, @function frob: .frame $17,16,$31 # vars= 0, regs= 1/0, args= 0, gp= 0 .mask 0x00020000,-8 .fmask 0x00000000,0 daddiu $sp,-16 sd $17,8($sp) move $17,$sp ld $2,.L3 move $sp,$17 ld $17,8($sp) daddiu $sp,16 jr $31 .type __pool_frob_3, @object __pool_frob_3: .align 3 .L3: .dword 305419896 .type __pend_frob_3, @function __pend_frob_3: .insn .end frob .size frob, .-frob .ident "GCC: (GNU) 8.0.1 20180410 (experimental)" (we have no support for hard-float n64 MIPS16 code generation), which means that the test case will fail, as the regular expression pattern expects `lw' and `.word' rather than `ld' and `.dword' respectively to appear in assembly code generation. Correct the pattern in an obvious way then making it accept both intructions and pseudo-ops. gcc/testsuite/ * gcc.target/mips/data-sym-pool.c (dg-options): Match `ld' and `.dword' in addition to `lw' and `.word'. --- Hi, I have regression-tested this with the `mips-mti-linux-gnu' target and the o32 ABI. I don't have an n64 soft-float multilib configured, so the manually generated assembly file included with the description serves as the proof for what needs to be matched. OK to apply? Maciej --- gcc/testsuite/gcc.target/mips/data-sym-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) gcc-mips16-test-data-sym-pool-dword.diff Index: gcc/gcc/testsuite/gcc.target/mips/data-sym-pool.c =================================================================== --- gcc.orig/gcc/testsuite/gcc.target/mips/data-sym-pool.c 2018-04-10 23:27:49.000000000 +0100 +++ gcc/gcc/testsuite/gcc.target/mips/data-sym-pool.c 2018-04-10 23:37:05.357453843 +0100 @@ -26,4 +26,4 @@ __pend_frob_3: # The symbol must mat symbol from being placed in the constant pool at `-O0' for SVR4 code and consequently interfering with test expectations. */ -/* { dg-final { scan-assembler "\tlw\t\\\$\[0-9\]+,(.L(\[0-9\]+))\n.*\t\\.type\t(__pool_frob_\\2), @object\n\\3:\n\t\\.align\t2\n\\1:\n\t\\.word\t305419896\n\t\\.type\t(__pend_frob_\\2), @function\n\\4:\n\t\\.insn\n" } } */ +/* { dg-final { scan-assembler "\tl\[wd\]\t\\\$\[0-9\]+,(.L(\[0-9\]+))\n.*\t\\.type\t(__pool_frob_\\2), @object\n\\3:\n\t\\.align\t2\n\\1:\n\t\\.d?word\t305419896\n\t\\.type\t(__pend_frob_\\2), @function\n\\4:\n\t\\.insn\n" } } */