Message ID | EF0EEFDB-D63F-4F75-8781-7E7DA400480E@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 90C21385AC30 for <patchwork@sourceware.org>; Fri, 17 Sep 2021 19:51:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90C21385AC30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1631908319; bh=R86NqFtwdssr14vAU4URnT4h63PhXKW1mNVn7Ekf4u4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gVLMkzE3mUgxaGuf5ZNFkcLao+4Vswjd5BT/ybdfc93cmX0j9NXNhTU+CJQHLixpd LYSRWxTU8o6sketsu2jDw6TMG0PiUloqs7cjFWUnhY60z0s6V+4HvhTyjHh793LC4v zFsgtKMFobCI3HNehuwLq382ClPVUhHz4IQOe0IQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 07BB7385AC2E for <gcc-patches@gcc.gnu.org>; Fri, 17 Sep 2021 19:48:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 07BB7385AC2E Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18HIxE3P009312; Fri, 17 Sep 2021 19:48:43 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3b4u8ssg8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Sep 2021 19:48:43 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 18HJfLGv069734; Fri, 17 Sep 2021 19:48:42 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by userp3030.oracle.com with ESMTP id 3b0hk182u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Sep 2021 19:48:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IVB0biW5QrJXlx6CCONkQgZRKSxsNFONiCoM3w9B4YeP4HLupPHX9PN5ViuWsTsusjlv1+kmGtytm1pH3PeZrWYwcKISxd5/4YYslWF0N7joe+e9qXFvZZmRtccQi2Sd6A3xj+JgxHxgpJjaNBDfjUZvgYK/6i3pSyOS5xc/u/EMHWBDpu3tLCbsiIPpeUEDC0H8ifECBNI79et6TPtj+THmKvWo1msEzY+kclU5xsvmKXTzzkjoFgo9B1QfmZzCReNBLij4Xo9//z2rVS1OVL9nzmZz8l7C/ZdcUa5jzZ99lvrKE6RN0CdLGL48Gsuso+0rdz5x2Zio5+FGr0EvSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=R86NqFtwdssr14vAU4URnT4h63PhXKW1mNVn7Ekf4u4=; b=kaqLhloH0ToAHI5p9SL2SjKgsMMgAA9djEAJEbo1uest1L1c1E5Ixzj05rxweRmEqVFVuBYytcd0JWjZQpS4va+N9u03yj+tv8VRqWcuXmM7CVaaf7Q20+7AgrX70yR8+OhytnpDdz31hPC8vXH27t79qbC8n61Z2Jbh8/medvFTbQj4AXUrd2scNeWw+rUfY/0Mw6Rf5OJCM4NPFLlUMy21lxoSPEFfxCRQBgwDXTlb3vYEUrFv0lE3jG7DzEwLNAaSb7Vm19vim0BomwX+gISn2M2ysy9pP9i27YemBShyOG4uM8my2mmc+sHyEy+28+/zASgUOi4rXf5WdJ5W7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from CH2PR10MB4344.namprd10.prod.outlook.com (2603:10b6:610:af::19) by CH0PR10MB5338.namprd10.prod.outlook.com (2603:10b6:610:cb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Fri, 17 Sep 2021 19:48:40 +0000 Received: from CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::25f8:eaf:a3b9:fe86]) by CH2PR10MB4344.namprd10.prod.outlook.com ([fe80::25f8:eaf:a3b9:fe86%3]) with mapi id 15.20.4523.017; Fri, 17 Sep 2021 19:48:40 +0000 To: jakub Jelinek <jakub@redhat.com>, Richard Biener <rguenther@suse.de> Subject: [HELP Needed!][PATCH] testsuite: Fix gcc.target/aarch64/auto-init-* tests. Thread-Topic: [HELP Needed!][PATCH] testsuite: Fix gcc.target/aarch64/auto-init-* tests. Thread-Index: AQHXq/0DF5KV+0FQ90O8mTUS1umgsg== Date: Fri, 17 Sep 2021 19:48:40 +0000 Message-ID: <EF0EEFDB-D63F-4F75-8781-7E7DA400480E@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3608.120.23.2.7) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9ce9a26-0848-4c9c-5294-08d97a1425ed x-ms-traffictypediagnostic: CH0PR10MB5338: x-microsoft-antispam-prvs: <CH0PR10MB53388031CFDE5B0B7438C22A80DD9@CH0PR10MB5338.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e4orpOTz+jbzlmPqVqgkUbYhrv/gUoAKhZrVTsIMAJdJojDHb0n/ahtkGwBQcVheYugMXUcOR1m63ed+69qb/9sfWkUTYhakasRJYoAgWXcTNkFWQs+zfAjsv0q+Fm1lbFHK5wgX7lEIv5b8kc8zqizRnZba3aU4mXjEN0w9+reiWnTQznele2AFQ37G1kHFWYg7NWtIbbFkoWopwcffDumVikDUPwEpOENqjlGH84bF59DcR2nrDhox5gPdEnlNWIgGEgTMiP/oJL7xaq8CReG4nw87yAbMUFLOaHKH/MQOqQ1t9s2V/CDBXtE2MOMFpuM84xdE3T21PB8TTm+vICLGoiZNVSNYPiQ//2rcBnFXuTtPn1pexthNXsAd/EECrzhOWKa2CUVNtTkEyjbhL03arbxRhM9rGNj6BG9G7AV06erUspmcRue6gbslydLhjxcREpxyttalCZZCvoGj6L9SlX8eyiB5jMPwMTaBKBAVjGCseN763JBGZHq+DgUbQ/s6BO7dQdPEfPFM5VaSHryFpnybAGSgXdO5UskSb/suOl9N1wA95IBxlhrXU0bAnNC3F6s4etA15jqpzSv5SObrioTqZIpTVb5+D6YVViww3LWGCz18sHTanLIopKs8wDOVQQHubJTyeSiSOsBuZfiFZyhCyr/5pNjLRYO11vWdlu+Kv3fwNnPCpP3BSDt0ClvcCV0aTvyp79okC6v7hu9RLAiHOLR8/GAQfekF9DsvlF8b38M67OlSBiB29Ilt x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR10MB4344.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(76116006)(66556008)(66476007)(6486002)(71200400001)(4326008)(2616005)(6512007)(91956017)(38070700005)(110136005)(6506007)(66946007)(64756008)(508600001)(66446008)(5660300002)(33656002)(186003)(2906002)(36756003)(83380400001)(44832011)(8936002)(86362001)(316002)(8676002)(122000001)(38100700002)(45980500001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?MPHWR/MHqBw/Bw5iq008SMBwZUE/?= =?utf-8?q?i6Y76rd5p+zQ873IpU4h/Zs/JBV+WaHacVCjL3/s4sTzq+QvPUJibAHF6CO1AHCa4?= =?utf-8?q?Aqs/6OwT6f8za/R35zdkh7HwLHAmca/PeUK8IXPCsF4+SduwBScIh3Bj+i6YI//Up?= =?utf-8?q?LTN0kRJNGNNDG48JY3Bx4SAkcHUQlPyrWXoNdDkS1+U0588uWx+5ocHqtSYynzX6Z?= =?utf-8?q?qdl1cQlcWML3u9UcwpThQQQpyW+jk4QNIb/9M0uUjToP6yhfx0SmuYNMqfHsW6wyy?= =?utf-8?q?hoh0KJzaSubHARV1o4+BPxTC14vxiTAvsurpvYdSSObk/FKACZ59sLS+R0JpBxr9b?= =?utf-8?q?D6FeDwr4nSmXeDC9svKYD2c+QGQJv+ToSK/V4p3cr2nQksVo4lD4eZndfG9Ue7R3h?= =?utf-8?q?k4VAf8dECDjXwOlPgHVXKVrz8k3PKLSRkTXgULoend0iCdFhFQyw4WdkPAwzxZTtV?= =?utf-8?q?gaQ17h7K6tjpOs6aXajPc6HsQBqf2SoDS2OX7hV1bPQr4DOQDaJYZRpLty0ehAkOg?= =?utf-8?q?gMmGrI33CJPZcCz0Ot5D4wpcRtHY16606gbrVt+CjMJUcXzNa3PF0vOSZuqKaO2Rh?= =?utf-8?q?txXqmc2GqwtAaCXulBM75zGXnTyVFWtPCC19Fv8G4D2bc7kR/saq6rE6fSIPZYbs0?= =?utf-8?q?vLMk0iftGekM1itgCXiVGwmU4scezNq4TxvlbyYXQQCF8GHNphmKT3ewmTa8T0FhV?= =?utf-8?q?VYPC1pF/xFNAd/4BA2psfA2662oNgb5/5SRvJnj2V3XEPR1Yj6VUmrS5ye+RN6vtq?= =?utf-8?q?aZvhEQ1bTPubB3gyTYu9AXUOgu5I43YQQIulbThgQz+wRJQEy3AUZmCHB9Eu+wchr?= =?utf-8?q?oBofFLbnFI0fxYuU5iN0YVTPKnRosxyZpe+Cn0bbbDgDpjtw9jJmR6RgMKm5m+xpc?= =?utf-8?q?9mdfmkA2W795dd2heR0Np0T2GQqTWGKoFxAMGf85QKtvGfqDZm+RN/fVYilLfx9Cs?= =?utf-8?q?KixWmLMaiOYCAASRIyR9e901sx1rTOkiVEv/GUN/Jc/0+4wnvAXJqaouExKx8kKH+?= =?utf-8?q?hmpTyTcY6emCUlSMmNdop3k9aCJDTh1+XNqgi74rWfWoVkng54uibYGPOYwa74bPP?= =?utf-8?q?IH8Xq3F5EruJVsDVt2Yv6E93OdiG8Zq2o6B6vnu9RL+oQPI5eD5IyHvX0piRlo+sc?= =?utf-8?q?H6XijPjNKkiFXYytNuJ1FKfmAPsTM2gCbd3ukyZwEnUkpimo8r4021qXzV6w7r6L4?= =?utf-8?q?YYHjP3XAYuPk1kF2g+Li5XCj+/hWuVf9+NJOEArp89bXNwnXRUAgAaoiFMOKw1trq?= =?utf-8?q?3WEOKibom+EZk5xhY0A699matszTKJ+FQx7X9UrEKIBmK6py3h2s8JDVeoU=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="utf-8" Content-ID: <269538B984198E4EB2D0C1BA17A39385@namprd10.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR10MB4344.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9ce9a26-0848-4c9c-5294-08d97a1425ed X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2021 19:48:40.3153 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jKrNWrRcACe1DJmP2OwIqhVScLB9hnWJcFQkwCpOMYPdNXm78gCfC6jnAbxHcZ3MxPc0Q4UB8HzeROzeYv5Q8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5338 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10110 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109170117 X-Proofpoint-ORIG-GUID: dE6lMBB_J5fxCAqc2mY-Ipa739YHtLF4 X-Proofpoint-GUID: dE6lMBB_J5fxCAqc2mY-Ipa739YHtLF4 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_L3, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Qing Zhao via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Qing Zhao <qing.zhao@oracle.com> Cc: gcc-patches Nick Alcock via <gcc-patches@gcc.gnu.org> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[HELP,Needed!] testsuite: Fix gcc.target/aarch64/auto-init-* tests.
|
|
Commit Message
Qing Zhao
Sept. 17, 2021, 7:48 p.m. UTC
Hi, There are much less issues with aarch64/auto-init-* test cases. Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. Only 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. Naturally the patch for this set is: A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” The above A fixed issue 1, however, the above B did not fix issue 2. If I fixed “auto-init-1.c” as: So, I took a look at the log file of the testing, and found that, If I tested it as: make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ In the log file, I got: /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. Is this a bug in aarch64 testing suite? Thanks. Qing
Comments
On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: > Hi, > > There are much less issues with aarch64/auto-init-* test cases. > Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. > > Only > > 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. > 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. > > Naturally the patch for this set is: > > A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; > B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” > > > The above A fixed issue 1, however, the above B did not fix issue 2. > > If I fixed “auto-init-1.c” as: > > diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c > index 0fa4708..a38d91b 100644 > --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c > +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c > @@ -1,6 +1,6 @@ > /* Verify zero initialization for integer and pointer type automatic variables. */ > /* { dg-do compile } */ > -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ > +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ > > #ifndef __cplusplus > # define bool _Bool > > So, I took a look at the log file of the testing, and found that, If I tested it as: > > make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ > > In the log file, I got: > > /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s > > From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. > > What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? > > For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. > Can you check that you are using the same version of dejagnu on both platforms? R. > Is this a bug in aarch64 testing suite? > > Thanks. > > Qing > >
> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: > > > > On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >> Hi, >> There are much less issues with aarch64/auto-init-* test cases. >> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >> Only >> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >> Naturally the patch for this set is: >> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >> The above A fixed issue 1, however, the above B did not fix issue 2. >> If I fixed “auto-init-1.c” as: >> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >> index 0fa4708..a38d91b 100644 >> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >> @@ -1,6 +1,6 @@ >> /* Verify zero initialization for integer and pointer type automatic variables. */ >> /* { dg-do compile } */ >> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >> #ifndef __cplusplus >> # define bool _Bool >> So, I took a look at the log file of the testing, and found that, If I tested it as: >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >> In the log file, I got: >> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. > > Can you check that you are using the same version of dejagnu on both platforms? Stupid question: how to check the version of it? Qing > > R. > >> Is this a bug in aarch64 testing suite? >> Thanks. >> Qing
On 20/09/2021 13:47, Qing Zhao wrote: > > >> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >> >> >> >> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>> Hi, >>> There are much less issues with aarch64/auto-init-* test cases. >>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>> Only >>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>> Naturally the patch for this set is: >>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>> The above A fixed issue 1, however, the above B did not fix issue 2. >>> If I fixed “auto-init-1.c” as: >>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>> index 0fa4708..a38d91b 100644 >>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>> @@ -1,6 +1,6 @@ >>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>> /* { dg-do compile } */ >>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>> #ifndef __cplusplus >>> # define bool _Bool >>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>> In the log file, I got: >>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >> >> Can you check that you are using the same version of dejagnu on both platforms? > > Stupid question: how to check the version of it? > $ runtest --version R. > Qing >> >> R. >> >>> Is this a bug in aarch64 testing suite? >>> Thanks. >>> Qing >
> On Sep 20, 2021, at 8:18 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: > > > > On 20/09/2021 13:47, Qing Zhao wrote: >>> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>> >>> >>> >>> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>>> Hi, >>>> There are much less issues with aarch64/auto-init-* test cases. >>>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>>> Only >>>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>>> Naturally the patch for this set is: >>>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>>> The above A fixed issue 1, however, the above B did not fix issue 2. >>>> If I fixed “auto-init-1.c” as: >>>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>> index 0fa4708..a38d91b 100644 >>>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>> @@ -1,6 +1,6 @@ >>>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>>> /* { dg-do compile } */ >>>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>>> #ifndef __cplusplus >>>> # define bool _Bool >>>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>>> In the log file, I got: >>>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >>> >>> Can you check that you are using the same version of dejagnu on both platforms? >> Stupid question: how to check the version of it? > > $ runtest --version Thanks. On aarch64: qinzhao@gcc116:~/Work/GCC/build_git$ runtest --version Expect version is 5.45 Tcl version is 8.6 Framework version is 1.5 On X86: [opc@qinzhao-ol8u3-x86 gcc]$ runtest --version WARNING: Couldn't find the global config file. DejaGnu version 1.6.1 Expect version 5.45.4 Tcl version 8.6 So, is there anything wrong with the installation of runtest on X86? Qing > > R. > >> Qing >>> >>> R. >>> >>>> Is this a bug in aarch64 testing suite? >>>> Thanks. >>>> Qing
On 20/09/2021 14:55, Qing Zhao wrote: > > >> On Sep 20, 2021, at 8:18 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >> >> >> >> On 20/09/2021 13:47, Qing Zhao wrote: >>>> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>> >>>> >>>> >>>> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>>>> Hi, >>>>> There are much less issues with aarch64/auto-init-* test cases. >>>>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>>>> Only >>>>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>>>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>>>> Naturally the patch for this set is: >>>>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>>>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>>>> The above A fixed issue 1, however, the above B did not fix issue 2. >>>>> If I fixed “auto-init-1.c” as: >>>>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>> index 0fa4708..a38d91b 100644 >>>>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>> @@ -1,6 +1,6 @@ >>>>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>>>> /* { dg-do compile } */ >>>>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>>>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>>>> #ifndef __cplusplus >>>>> # define bool _Bool >>>>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>>>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>>>> In the log file, I got: >>>>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>>>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>>>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>>>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >>>> >>>> Can you check that you are using the same version of dejagnu on both platforms? >>> Stupid question: how to check the version of it? >> >> $ runtest --version > > Thanks. > > On aarch64: > qinzhao@gcc116:~/Work/GCC/build_git$ runtest --version > Expect version is 5.45 > Tcl version is 8.6 > Framework version is 1.5 Ok, so this is dejagnu 1.5 (older versions of dejagnu reported the 'framework version') ... > > On X86: > [opc@qinzhao-ol8u3-x86 gcc]$ runtest --version > WARNING: Couldn't find the global config file. > DejaGnu version 1.6.1 > Expect version 5.45.4 > Tcl version 8.6 While this is dejagnu 1.6.1 IIRC there were some changes to the way various options were combined at one point and I suspect this may be the source of your problem. Can you update your dejagnu on your aarch64 system to be the same as that on x86? R. > > So, is there anything wrong with the installation of runtest on X86? > > Qing > > >> >> R. >> >>> Qing >>>> >>>> R. >>>> >>>>> Is this a bug in aarch64 testing suite? >>>>> Thanks. >>>>> Qing >
> On Sep 20, 2021, at 9:36 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: > > > > On 20/09/2021 14:55, Qing Zhao wrote: >>> On Sep 20, 2021, at 8:18 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>> >>> >>> >>> On 20/09/2021 13:47, Qing Zhao wrote: >>>>> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>>> >>>>> >>>>> >>>>> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>>>>> Hi, >>>>>> There are much less issues with aarch64/auto-init-* test cases. >>>>>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>>>>> Only >>>>>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>>>>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>>>>> Naturally the patch for this set is: >>>>>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>>>>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>>>>> The above A fixed issue 1, however, the above B did not fix issue 2. >>>>>> If I fixed “auto-init-1.c” as: >>>>>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>> index 0fa4708..a38d91b 100644 >>>>>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>> @@ -1,6 +1,6 @@ >>>>>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>>>>> /* { dg-do compile } */ >>>>>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>>>>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>>>>> #ifndef __cplusplus >>>>>> # define bool _Bool >>>>>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>>>>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>>>>> In the log file, I got: >>>>>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>>>>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>>>>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>>>>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >>>>> >>>>> Can you check that you are using the same version of dejagnu on both platforms? >>>> Stupid question: how to check the version of it? >>> >>> $ runtest --version >> Thanks. >> On aarch64: >> qinzhao@gcc116:~/Work/GCC/build_git$ runtest --version >> Expect version is 5.45 >> Tcl version is 8.6 >> Framework version is 1.5 > > Ok, so this is dejagnu 1.5 (older versions of dejagnu reported the 'framework version') ... > >> On X86: >> [opc@qinzhao-ol8u3-x86 gcc]$ runtest --version >> WARNING: Couldn't find the global config file. >> DejaGnu version 1.6.1 >> Expect version 5.45.4 >> Tcl version 8.6 > > While this is dejagnu 1.6.1 > > IIRC there were some changes to the way various options were combined at one point and I suspect this may be the source of your problem. Can you update your dejagnu on your aarch64 system to be the same as that on x86? The aarch64 machine I used is a GCC farm machine, looks like it has an older version of dejagnu. I don’t have permission to update it myself. I will use another aarch64 machine to test this to see whether a higher version of dejagnu can resolve the issue or not. Thanks a lot for your help. Qing > > R. > >> So, is there anything wrong with the installation of runtest on X86? >> Qing >>> >>> R. >>> >>>> Qing >>>>> >>>>> R. >>>>> >>>>>> Is this a bug in aarch64 testing suite? >>>>>> Thanks. >>>>>> Qing
On 20/09/2021 16:51, Qing Zhao via Gcc-patches wrote: > > >> On Sep 20, 2021, at 9:36 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >> >> >> >> On 20/09/2021 14:55, Qing Zhao wrote: >>>> On Sep 20, 2021, at 8:18 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>> >>>> >>>> >>>> On 20/09/2021 13:47, Qing Zhao wrote: >>>>>> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>>>> >>>>>> >>>>>> >>>>>> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>>>>>> Hi, >>>>>>> There are much less issues with aarch64/auto-init-* test cases. >>>>>>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>>>>>> Only >>>>>>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>>>>>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>>>>>> Naturally the patch for this set is: >>>>>>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>>>>>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>>>>>> The above A fixed issue 1, however, the above B did not fix issue 2. >>>>>>> If I fixed “auto-init-1.c” as: >>>>>>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>>> index 0fa4708..a38d91b 100644 >>>>>>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>>> @@ -1,6 +1,6 @@ >>>>>>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>>>>>> /* { dg-do compile } */ >>>>>>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>>>>>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>>>>>> #ifndef __cplusplus >>>>>>> # define bool _Bool >>>>>>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>>>>>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>>>>>> In the log file, I got: >>>>>>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>>>>>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>>>>>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>>>>>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >>>>>> >>>>>> Can you check that you are using the same version of dejagnu on both platforms? >>>>> Stupid question: how to check the version of it? >>>> >>>> $ runtest --version >>> Thanks. >>> On aarch64: >>> qinzhao@gcc116:~/Work/GCC/build_git$ runtest --version >>> Expect version is 5.45 >>> Tcl version is 8.6 >>> Framework version is 1.5 >> >> Ok, so this is dejagnu 1.5 (older versions of dejagnu reported the 'framework version') ... >> >>> On X86: >>> [opc@qinzhao-ol8u3-x86 gcc]$ runtest --version >>> WARNING: Couldn't find the global config file. >>> DejaGnu version 1.6.1 >>> Expect version 5.45.4 >>> Tcl version 8.6 >> >> While this is dejagnu 1.6.1 >> >> IIRC there were some changes to the way various options were combined at one point and I suspect this may be the source of your problem. Can you update your dejagnu on your aarch64 system to be the same as that on x86? > > The aarch64 machine I used is a GCC farm machine, looks like it has an older version of dejagnu. I don’t have permission to update it myself. > > I will use another aarch64 machine to test this to see whether a higher version of dejagnu can resolve the issue or not. You could probably try installing a local copy of dejagnu in, for example, ~/tools and then adding that to your path before the system version. R. > > Thanks a lot for your help. > > Qing >> >> R. >> >>> So, is there anything wrong with the installation of runtest on X86? >>> Qing >>>> >>>> R. >>>> >>>>> Qing >>>>>> >>>>>> R. >>>>>> >>>>>>> Is this a bug in aarch64 testing suite? >>>>>>> Thanks. >>>>>>> Qing >
> On Sep 20, 2021, at 10:59 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: > > > > On 20/09/2021 16:51, Qing Zhao via Gcc-patches wrote: >>> On Sep 20, 2021, at 9:36 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>> >>> >>> >>> On 20/09/2021 14:55, Qing Zhao wrote: >>>>> On Sep 20, 2021, at 8:18 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>>> >>>>> >>>>> >>>>> On 20/09/2021 13:47, Qing Zhao wrote: >>>>>>> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>>>>>>> Hi, >>>>>>>> There are much less issues with aarch64/auto-init-* test cases. >>>>>>>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>>>>>>> Only >>>>>>>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>>>>>>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>>>>>>> Naturally the patch for this set is: >>>>>>>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>>>>>>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>>>>>>> The above A fixed issue 1, however, the above B did not fix issue 2. >>>>>>>> If I fixed “auto-init-1.c” as: >>>>>>>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>>>> index 0fa4708..a38d91b 100644 >>>>>>>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>>>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>>>> @@ -1,6 +1,6 @@ >>>>>>>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>>>>>>> /* { dg-do compile } */ >>>>>>>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>>>>>>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>>>>>>> #ifndef __cplusplus >>>>>>>> # define bool _Bool >>>>>>>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>>>>>>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>>>>>>> In the log file, I got: >>>>>>>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>>>>>>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>>>>>>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>>>>>>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >>>>>>> >>>>>>> Can you check that you are using the same version of dejagnu on both platforms? >>>>>> Stupid question: how to check the version of it? >>>>> >>>>> $ runtest --version >>>> Thanks. >>>> On aarch64: >>>> qinzhao@gcc116:~/Work/GCC/build_git$ runtest --version >>>> Expect version is 5.45 >>>> Tcl version is 8.6 >>>> Framework version is 1.5 >>> >>> Ok, so this is dejagnu 1.5 (older versions of dejagnu reported the 'framework version') ... >>> >>>> On X86: >>>> [opc@qinzhao-ol8u3-x86 gcc]$ runtest --version >>>> WARNING: Couldn't find the global config file. >>>> DejaGnu version 1.6.1 >>>> Expect version 5.45.4 >>>> Tcl version 8.6 >>> >>> While this is dejagnu 1.6.1 >>> >>> IIRC there were some changes to the way various options were combined at one point and I suspect this may be the source of your problem. Can you update your dejagnu on your aarch64 system to be the same as that on x86? >> The aarch64 machine I used is a GCC farm machine, looks like it has an older version of dejagnu. I don’t have permission to update it myself. >> I will use another aarch64 machine to test this to see whether a higher version of dejagnu can resolve the issue or not. > > You could probably try installing a local copy of dejagnu in, for example, ~/tools and then adding that to your path before the system version. Will try this too. thanks. Qing > > R. > >> Thanks a lot for your help. >> Qing >>> >>> R. >>> >>>> So, is there anything wrong with the installation of runtest on X86? >>>> Qing >>>>> >>>>> R. >>>>> >>>>>> Qing >>>>>>> >>>>>>> R. >>>>>>> >>>>>>>> Is this a bug in aarch64 testing suite? >>>>>>>> Thanks. >>>>>>>> Qing
By using a newer version of dejagnu on aarch64, the options in the testing cases are appended AFTER the options in the RUNTESTFLAGS. As a result, my patch to the aarch64/auto-init-* tests passed without issue. Thanks a lot for your help. Qing > On Sep 20, 2021, at 9:36 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: > > > > On 20/09/2021 14:55, Qing Zhao wrote: >>> On Sep 20, 2021, at 8:18 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>> >>> >>> >>> On 20/09/2021 13:47, Qing Zhao wrote: >>>>> On Sep 20, 2021, at 5:43 AM, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote: >>>>> >>>>> >>>>> >>>>> On 17/09/2021 20:48, Qing Zhao via Gcc-patches wrote: >>>>>> Hi, >>>>>> There are much less issues with aarch64/auto-init-* test cases. >>>>>> Different -march values (from ‘armv8-a’, ‘armv8.1-a’, till ‘armv8.6-a’, ‘armv8-r’) do not change the pattern match. >>>>>> Only >>>>>> 1. -mabi=ilp32/lp64 impact two of the testing cases “auto-init-2.c” and “auto-init-padding-5.c”. >>>>>> 2. -fstack-clash-protection impact two of the testing cases “auto-init-1.c” and “auto-init-7.c”. >>>>>> Naturally the patch for this set is: >>>>>> A. Adjust the patterns for ilp32 or lp64 in “auto-init-2.c” and “auto-init-padding-5.c”; >>>>>> B. Add -fno-stack-protector to “auto-init-1.c” and “auto-init-7.c” >>>>>> The above A fixed issue 1, however, the above B did not fix issue 2. >>>>>> If I fixed “auto-init-1.c” as: >>>>>> diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>> index 0fa4708..a38d91b 100644 >>>>>> --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>> +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c >>>>>> @@ -1,6 +1,6 @@ >>>>>> /* Verify zero initialization for integer and pointer type automatic variables. */ >>>>>> /* { dg-do compile } */ >>>>>> -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ >>>>>> +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ >>>>>> #ifndef __cplusplus >>>>>> # define bool _Bool >>>>>> So, I took a look at the log file of the testing, and found that, If I tested it as: >>>>>> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=lp64/-fstack-clash-protection/-fstack-protector-all\} aarch64.exp=auto-init*’ >>>>>> In the log file, I got: >>>>>> /home/qinzhao/Work/GCC/build_git/gcc/xgcc -B/home/qinzhao/Work/GCC/build_git/gcc/ /home/qinzhao/Work/GCC/latest_gcc_git/gcc/testsuite/gcc.target/aarch64/auto-init-1.c -fdiagnostics-plain-output -ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -ffat-lto-objects -S -mabi=lp64 -fstack-clash-protection -fstack-protector-all -o auto-init-1.s >>>>>> From it, we can see, that the options that were passed through RUNTESTFLAGS “mabi-lp64 -fstack-clash-protection -fstack-protector-all” were appended AFTER the options inside the testing case through “dg-options”. As a result, the option “-fno-stack-protector” did not have any impact at all. >>>>>> What’s the expected behavior for the order of these options? Should options through RUNTESTFLAGS be appended BEFORE or AFTER the options through testing cases? >>>>>> For X86, the options through RUNTESTFLAGS are added BEFORE the options through testing cases. Therefore adding “-fno-stack-protector” has the expected result. >>>>> >>>>> Can you check that you are using the same version of dejagnu on both platforms? >>>> Stupid question: how to check the version of it? >>> >>> $ runtest --version >> Thanks. >> On aarch64: >> qinzhao@gcc116:~/Work/GCC/build_git$ runtest --version >> Expect version is 5.45 >> Tcl version is 8.6 >> Framework version is 1.5 > > Ok, so this is dejagnu 1.5 (older versions of dejagnu reported the 'framework version') ... > >> On X86: >> [opc@qinzhao-ol8u3-x86 gcc]$ runtest --version >> WARNING: Couldn't find the global config file. >> DejaGnu version 1.6.1 >> Expect version 5.45.4 >> Tcl version 8.6 > > While this is dejagnu 1.6.1 > > IIRC there were some changes to the way various options were combined at one point and I suspect this may be the source of your problem. Can you update your dejagnu on your aarch64 system to be the same as that on x86? > > R. > >> So, is there anything wrong with the installation of runtest on X86? >> Qing >>> >>> R. >>> >>>> Qing >>>>> >>>>> R. >>>>> >>>>>> Is this a bug in aarch64 testing suite? >>>>>> Thanks. >>>>>> Qing
diff --git a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c index 0fa4708..a38d91b 100644 --- a/gcc/testsuite/gcc.target/aarch64/auto-init-1.c +++ b/gcc/testsuite/gcc.target/aarch64/auto-init-1.c @@ -1,6 +1,6 @@ /* Verify zero initialization for integer and pointer type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector" } */ #ifndef __cplusplus # define bool _Bool