From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117407 invoked by alias); 9 Sep 2016 13:29:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 117382 invoked by uid 89); 9 Sep 2016 13:29:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=D*hotmail.de, ptr_mode, 2074, fselftest X-HELO: COL004-OMC3S3.hotmail.com Received: from col004-omc3s3.hotmail.com (HELO COL004-OMC3S3.hotmail.com) (65.55.34.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Sep 2016 13:29:08 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com ([65.55.34.135]) by COL004-OMC3S3.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 9 Sep 2016 06:29:06 -0700 Received: from AM5EUR02FT058.eop-EUR02.prod.protection.outlook.com (10.152.8.51) by AM5EUR02HT065.eop-EUR02.prod.protection.outlook.com (10.152.9.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.6; Fri, 9 Sep 2016 13:28:59 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com (10.152.8.51) by AM5EUR02FT058.mail.protection.outlook.com (10.152.9.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.6 via Frontend Transport; Fri, 9 Sep 2016 13:28:59 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com ([10.167.132.147]) by AM4PR0701MB2162.eurprd07.prod.outlook.com ([10.167.132.147]) with mapi id 15.01.0599.016; Fri, 9 Sep 2016 13:28:59 +0000 From: Bernd Edlinger To: David Malcolm CC: GCC Patches Subject: Re: [PATCH 9/9] cse.c selftests Date: Fri, 09 Sep 2016 13:32:00 -0000 Message-ID: authentication-results: spf=softfail (sender IP is 10.152.8.51) smtp.mailfrom=hotmail.de; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=hotmail.de; received-spf: SoftFail (protection.outlook.com: domain of transitioning hotmail.de discourages use of 10.152.8.51 as permitted sender) x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [CdmGc/YKgV3B7cvk7YZCGvL9/x5vugTX] x-eopattributedmessage: 0 x-forefront-antispam-report: CIP:10.152.8.51;IPV:NLI;CTRY:;EFV:NLI;SFV:NSPM;SFS:(10019020)(98900003);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5EUR02HT065;H:AM4PR0701MB2162.eurprd07.prod.outlook.com;FPR:;SPF:None;LANG:en; x-microsoft-exchange-diagnostics: 1;AM5EUR02HT065;6:1EfybcP6qwBZKUbksTHZAMjlOoE5qT3zHc2CYfBdxouHrPsIlcV/w4RUuYG9vE7HuRQ+TcbJRPVVuWqChxTWt2SJhfOnHkTYhIuAjuyxMlsLHV+q/Wpe2Q+TvcPDuqqbFwDe/gQ9AZMC+XlR7VwexEHwB5JR77SCRWnQIg+oAjJ26B8jtCtHe64LNbKoxSVzTyjE60GQkpubzMRr5sKHw0bcujZtX6ibI90Ryjk9JZ86s5vSdYS3xwLVwvg0jEyR5cUgIG8uaA2YmWEgk4cQdBBe2wNgaQWY+g3MqvHkIsGLizF4RLv5o8a1DxHaNO12;5:p6RVZcKnLTvLuh3Jx3ZjHD4bNTU2wZdxOlM0e9yBU163rjRXxHDsJMCwG4HjKPZSqW9mlR86JPy45Lf7tZvzZ2WqJfh7/6LrK4Mut++etcAJATMXca92mS/xVOKxfI1fNbW9uJSiJbDW01ej7lalyg==;24:EIq9NnyX+lKj5fgr3O0tafDMeWNinisKPBwFhxU9qgdhAhpHCkOIGLMlmKZdStImtaqM5Z6stUw2sFT+xyV349j2sITBmHX2DkFGQ1PVymc=;7:PfrNxYtpeFJE9HvWUpZI3PyrePudfBYva9vXiAkO5hx8QkS89rg2UdjYsKIZWuCL66Cyl43WA7xRUuR8tX5HF6YEHe2qe0f9HMgEGR2vJsREVXFzFkqmrE97ukYFcQemdIJACddDzqTTV5GqWq2WMDJ+URGGtCKSD1UqwudEmcEZtxUCcPYw/Vka0CKBp1xu1UMzXUWoyXWMmZXAbcgFYb52qoujtkBC0+gzc43MW7ezaNaVzcvG28GBU05AsaZk x-ms-office365-filtering-correlation-id: ebacbf9b-94d2-4408-c549-08d3d8b541c0 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(1601124038)(1603103081)(1601125047);SRVR:AM5EUR02HT065; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(432015012)(102415321)(82015046);SRVR:AM5EUR02HT065;BCL:0;PCL:0;RULEID:;SRVR:AM5EUR02HT065; x-forefront-prvs: 00603B7EEF spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/mixed; boundary="_002_AM4PR0701MB2162EBDBE6BABB6EA64C6D82E4FA0AM4PR0701MB2162_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Sep 2016 13:28:59.1353 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT065 X-SW-Source: 2016-09/txt/msg00497.txt.bz2 --_002_AM4PR0701MB2162EBDBE6BABB6EA64C6D82E4FA0AM4PR0701MB2162_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 3930 Hi David, > I attempted to create a reproducer for PR 71779; however I'm not yet > able to replicate the bogus cse reported there via the test case. Thanks, this is just awesome. I immediately had to try your patch. The main reason for PR 71779 was that this (insn 1047 1046 1048 (set (reg:DI 481) (subreg:DI (reg/f:SI 479) 0)) y.c:12702 -1 (nil)) got transformed into that: (insn 1047 1046 1048 107 (set (reg/f:DI 481) (subreg:DI (reg/f:SI 477) 0)) y.c:12702 50 {*movdi_aarch64} (expr_list:REG_DEAD (reg/f:SI 479) (nil))) Note the "/f at reg 481. This together with the fact that -mabi=3Dilp32 makes Pmode !=3D ptr_mode caused a cascade of different errors. For the wrong transformation in combine to happen, we need=20 Pmode =3D DImode, ptr_mode=3DSImode, and REG_POINTER(x) is true, but only REG_POINTER is really wrong. First the good news. The unit test does actually work, but not only on aarch even without -mabi=3Dilp32, but also on i386. All that's missing is a check that we don't get a reg/f here: test_pr71779 () { /* Only run this tests for target=3D=3Daarch64. */ #ifndef GCC_AARCH64_H #ifndef I386_OPTS_H return; #endif #endif ... tem =3D cse_main (get_insns (), max_reg_num ()); ASSERT_EQ (0, tem); ASSERT_FALSE (REG_POINTER (SET_DEST (PATTERN (get_insn_by_uid (1047))))); } Test fails on aarch64 and i386 if I revert the attached patch for PR 71779, and passes again, if I apply the patch again. Excellent! Attached for your reference, the original patch file from PR 71779. /home/ed/gnu/gcc-build-aarch64/./gcc/xgcc -B/home/ed/gnu/gcc-build-aarch64/= ./gcc/ -xc -S -c /dev/null -fself-test ../../gcc-trunk/gcc/cse.c:7872: test_pr71779: FAIL: ASSERT_FALSE (((__exten= sion__ ({ __typeof (((((PATTERN (get_insn_by_uid (1047)))->u.fld[0]).rt_rtx= ))) const _rtx =3D (((((PATTERN (get_insn_by_uid (1047)))->u.fld[0]).rt_rtx= ))); if (((enum rtx_code) (_rtx)->code) !=3D REG) rtl_check_failed_flag ("R= EG_POINTER", _rtx, "../../gcc-trunk/gcc/cse.c", 7872, __FUNCTION__); _rtx; = })->frame_related))) In function 'test_1': cc1: internal compiler error: in fail, at selftest.c:46 0x11bdd8e selftest::fail(selftest::location const&, char const*) ../../gcc-trunk/gcc/selftest.c:46 0x10944ec test_pr71779 ../../gcc-trunk/gcc/cse.c:7872 0x10944ec selftest::cse_c_tests() ../../gcc-trunk/gcc/cse.c:7881 0x11631fe selftest::run_tests() ../../gcc-trunk/gcc/selftest-run-tests.c:68 0xb36242 toplev::run_self_tests() ../../gcc-trunk/gcc/toplev.c:2074 I noticed, that ASSERT_FALSE does expand the macros, which makes the output a bit hard to read. One minor thing, an unrelated test did fail before the cse test got execute= d on my aarch64, so I just commented that part out: /home/ed/gnu/gcc-build-aarch64/./gcc/xgcc -B/home/ed/gnu/gcc-build-aarch64/= ./gcc/ -xc -S -c /dev/null -fself-test ../../gcc-trunk/gcc/read-rtl-function.c:923: test_loading_dump_fragment_2: = FAIL: ASSERT_TRUE ((((lhs)->frame_related))) In function 'test_1': cc1: internal compiler error: in fail, at selftest.c:46 0x11be8ae selftest::fail(selftest::location const&, char const*) ../../gcc-trunk/gcc/selftest.c:46 0x115577a test_loading_dump_fragment_2 ../../gcc-trunk/gcc/read-rtl-function.c:923 0x1157cce selftest::read_rtl_function_c_tests() ../../gcc-trunk/gcc/read-rtl-function.c:1183 0x1163d14 selftest::run_tests() ../../gcc-trunk/gcc/selftest-run-tests.c:66 0xb36262 toplev::run_self_tests() ../../gcc-trunk/gcc/toplev.c:2074 the aarch64 was configured this way: ../gcc-trunk/configure --prefix=3D/home/ed/gnu/aarch64-unknown-elf --target= =3Daarch64-unknown-elf --enable-languages=3Dc --disable-shared --disable-th= reads --disable-libssp --disable-libgomp --disable-libquadmath --disable-li= batomic Maybe one last comment on your patch itself, could you please move the unit test cases in extra unit test files, or even a self-test tree? Thanks Bernd.= --_002_AM4PR0701MB2162EBDBE6BABB6EA64C6D82E4FA0AM4PR0701MB2162_ Content-Type: text/x-patch; name="patch-pr71779.diff" Content-Description: patch-pr71779.diff Content-Disposition: attachment; filename="patch-pr71779.diff"; size=960; creation-date="Fri, 09 Sep 2016 13:12:00 GMT"; modification-date="Fri, 09 Sep 2016 13:12:00 GMT" Content-Transfer-Encoding: base64 Content-length: 1302 MjAxNi0wOC0wNCAgQmVybmQgRWRsaW5nZXIgIDxiZXJuZC5lZGxpbmdlckBo b3RtYWlsLmRlPgoKCVBSIHJ0bC1vcHRpbWl6YXRpb24vNzE3NzkKCSogZW1p dC1ydGwuYyAoc2V0X3JlZ19hdHRyc19mcm9tX3ZhbHVlKTogT25seSBwcm9w YWdhdGUgUkVHX1BPSU5URVIsCglpZiB0aGUgdmFsdWUgd2FzIHNpZ24tZXh0 ZW5kZWQgYWNjb3JkaW5nIHRvIFBPSU5URVJTX0VYVEVORF9VTlNJR05FRAoJ b3IgaWYgaXQgd2FzIHRydW5jYXRlZC4KCkluZGV4OiBnY2MvZW1pdC1ydGwu Ywo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBnY2MvZW1pdC1ydGwuYwko cmV2aXNpb24gMjM4OTE1KQorKysgZ2NjL2VtaXQtcnRsLmMJKHdvcmtpbmcg Y29weSkKQEAgLTExNTYsNyArMTE1NiwxMSBAQCBzZXRfcmVnX2F0dHJzX2Zy b21fdmFsdWUgKHJ0eCByZWcsIHJ0eCB4KQogICAgIHsKICNpZiBkZWZpbmVk KFBPSU5URVJTX0VYVEVORF9VTlNJR05FRCkKICAgICAgIGlmICgoKEdFVF9D T0RFICh4KSA9PSBTSUdOX0VYVEVORCAmJiBQT0lOVEVSU19FWFRFTkRfVU5T SUdORUQpCi0JICAgfHwgKEdFVF9DT0RFICh4KSAhPSBTSUdOX0VYVEVORCAm JiAhIFBPSU5URVJTX0VYVEVORF9VTlNJR05FRCkpCisJICAgfHwgKEdFVF9D T0RFICh4KSA9PSBaRVJPX0VYVEVORCAmJiAhIFBPSU5URVJTX0VYVEVORF9V TlNJR05FRCkKKwkgICB8fCAocGFyYWRveGljYWxfc3VicmVnX3AgKHgpCisJ ICAgICAgICYmICEgKFNVQlJFR19QUk9NT1RFRF9WQVJfUCAoeCkKKwkJICAg ICAmJiBTVUJSRUdfQ0hFQ0tfUFJPTU9URURfU0lHTiAoeCwKKwkJCQkJCSAg ICBQT0lOVEVSU19FWFRFTkRfVU5TSUdORUQpKSkpCiAJICAmJiAhdGFyZ2V0 bS5oYXZlX3B0cl9leHRlbmQgKCkpCiAJY2FuX2JlX3JlZ19wb2ludGVyID0g ZmFsc2U7CiAjZW5kaWYK --_002_AM4PR0701MB2162EBDBE6BABB6EA64C6D82E4FA0AM4PR0701MB2162_--