[{"id":1771172,"web_url":"http://patchwork.ozlabs.org/comment/1771172/","msgid":"<DB6PR0802MB23091A0E08F1A6292293EAAEFF600@DB6PR0802MB2309.eurprd08.prod.outlook.com>","list_archive_url":null,"date":"2017-09-19T15:54:12","subject":"Re: [PATCH] Fix PR79622","submitter":{"id":69689,"url":"http://patchwork.ozlabs.org/api/people/69689/","name":"Tamar Christina","email":"Tamar.Christina@arm.com"},"content":"-- sorry for the duplicate, forgot to post to list as well first time --\n\nHi Richard,\n\nThe testcase seems to fail on aarch64-none-elf when -O1 or -O2,\n\n-O0, -Os and -O3 seem to work fine.\n\ndc[0] ends up being 0 for the cases that fail.\n\nKind regards,\nTamar","headers":{"Return-Path":"<gcc-patches-return-462512-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462512-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"QVEW+RXI\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Tamar.Christina@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxS9q4Jrpz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 01:54:39 +1000 (AEST)","(qmail 26603 invoked by alias); 19 Sep 2017 15:54:18 -0000","(qmail 26476 invoked by uid 89); 19 Sep 2017 15:54:17 -0000","from mail-he1eur01on0075.outbound.protection.outlook.com (HELO\n\tEUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.75)\n\tby sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with\n\tESMTP; Tue, 19 Sep 2017 15:54:15 +0000","from DB6PR0802MB2309.eurprd08.prod.outlook.com (10.172.228.13) by\n\tDB6PR0802MB2423.eurprd08.prod.outlook.com (10.172.251.7) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.56.11; Tue, 19 Sep 2017 15:54:12 +0000","from DB6PR0802MB2309.eurprd08.prod.outlook.com\n\t([fe80::78a8:cb36:9798:56f]) by\n\tDB6PR0802MB2309.eurprd08.prod.outlook.com\n\t([fe80::78a8:cb36:9798:56f%17]) with mapi id 15.20.0056.016;\n\tTue, 19 Sep 2017 15:54:12 +0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:references:in-reply-to\n\t:content-type:content-transfer-encoding:mime-version; q=dns; s=\n\tdefault; b=pahGIwx6c7NDHdRMcP6TmuTja2nUIEBfbUw1iPpqvcRi0jdcSwTdI\n\tLLHZjjteud1t+ZXWOHsAy+3KssD2w21QesgDdJR0XG6SPyuHvCwIPQjz3WrqR5gm\n\taFgLdR0vb1Uq+tJJyjvDzxi3G3xwcKaUGRAOEF8dnMHqcjwtzoqMJM=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:references:in-reply-to\n\t:content-type:content-transfer-encoding:mime-version; s=default;\n\tbh=r2MVRjOOn7ndCka+STqgMnY8zt8=; b=QVEW+RXIX7j/Fq3+11YQ7C5hKlpt\n\tq9Dgt8q15KHaf6FsviFIr/yAtPk9PAodeXoQoaaGtRLj0/8YOS1cWGAmG/OCcdbh\n\ta0P6iHUCnIA5eVWaLzeXoSr5N4ixgNoybURY3igs9nP1+Sei3uSz6se8bmSuI0pw\n\tCmudw3HxE7+ZaNI=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-11.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=(unknown)","X-HELO":"EUR01-HE1-obe.outbound.protection.outlook.com","From":"Tamar Christina <Tamar.Christina@arm.com>","To":"Richard Biener <rguenther@suse.de>,\n\t\"gcc-patches@gcc.gnu.org\"\t<gcc-patches@gcc.gnu.org>","CC":"nd <nd@arm.com>","Subject":"Re: [PATCH] Fix PR79622","Date":"Tue, 19 Sep 2017 15:54:12 +0000","Message-ID":"<DB6PR0802MB23091A0E08F1A6292293EAAEFF600@DB6PR0802MB2309.eurprd08.prod.outlook.com>","References":"<alpine.LSU.2.20.1709180928410.26836@zhemvz.fhfr.qr>","In-Reply-To":"<alpine.LSU.2.20.1709180928410.26836@zhemvz.fhfr.qr>","authentication-results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462512-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"QVEW+RXI\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Tamar.Christina@arm.com; "],"x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; DB6PR0802MB2423;\n\t6:qKmhnYEtORQniKCiyNOGD5Jss0xF2RWbwxoRcS0pUg/bxUei6f2p4OkFu4CmIshR+aqMehbaxPq0jn0Je88CQG9zbP4DjkHDa59vA1XkwT0W/KqroZzpnAoR3Rg3CFkxUGQYCQLGAYTCOoE+hWNKnthTMKbmDPYjMd3DaXOpXoUW3/lNr1OkgL8TV9R6NgaCzaiaSZCLqxzV5dWsY68hhSa/CQjxZllxfzzbzCVYlktRi805zfucVMc8JDSfBC8tHDHmXe2Sl/lYypVEBxUl9gBDBOLrOQgwDRe1GmRLq/qcZzi5EAklshK/pDE4gM+eJd6ctk5AvTdlSTMdPTdRlA==;\n\t5:hQvBVXa/MwaDnGGfV60xY9mNw1aNph06TDcrc8bth4tGvt/rX/qXPALnA/9l/gH6UUOXnwVbzf/IAhl9UcUCwk3KvkbZlv8AzCvIgismdnJKLqku5l/3pKLERo98zGK4hCXSncCZiNeII/bpIU3Ncg==;\n\t24:0xfFmToukv5oyOhuZ9YX4IzYUrMkuA6LNqdTCD0i9PO0Z0xKxm+0Q0sXfB326p/vaa2pOnfklsjETgj2Qm9SToPcb2b/d9ZYglF6zgITaj4=;\n\t7:FY+ImCy/G2L5chjrif0lSIfpKtRLjHJUo4V0ecFAZVeqJIW89WYLqMtvkDtup+8l1Mp9RVmTuTYSFG+m6DIgic4E/m1W0xU62hn+rvt34FuxgVCRDa8vaRkGC0+H6iCmlD9JlnFc1kJneHMPeI/QYpMYF4ZVjmKn9WRj2AHwWe4l5HPI9SF3JktgH/o3eXEXsC1MB7aTPkIEXssiYlHtiazdBOTxqtvZHUiH10q2M10=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"ff5f7349-6750-4de4-793a-08d4ff76abe3","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB6PR0802MB2423; ","x-ms-traffictypediagnostic":"DB6PR0802MB2423:","nodisclaimer":"True","x-exchange-antispam-report-test":"UriScan:(22074186197030)(183786458502308);","x-microsoft-antispam-prvs":"<DB6PR0802MB2423062AB2833010B01AFA82FF600@DB6PR0802MB2423.eurprd08.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB6PR0802MB2423; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB6PR0802MB2423; ","x-forefront-prvs":"04359FAD81","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(376002)(346002)(377424004)(377454003)(189002)(199003)(6506006)(4326008)(14454004)(6246003)(74316002)(3660700001)(316002)(105586002)(106356001)(110136005)(3846002)(6116002)(102836003)(72206003)(5660300001)(97736004)(7696004)(86362001)(81166006)(8936002)(189998001)(2501003)(66066001)(229853002)(101416001)(53546010)(81156014)(33656002)(68736007)(9686003)(2906002)(5250100002)(53936002)(2900100001)(50986999)(76176999)(305945005)(54356999)(8676002)(2950100002)(99286003)(25786009)(6436002)(3280700002)(7736002)(478600001)(55016002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2423;\n\tH:DB6PR0802MB2309.eurprd08.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","received-spf":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"19 Sep 2017 15:54:12.0336\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"f34e5979-57d9-4aaa-ad4d-b122a662184d","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB6PR0802MB2423","X-IsSubscribed":"yes"}},{"id":1772067,"web_url":"http://patchwork.ozlabs.org/comment/1772067/","msgid":"<CAFiYyc22wDn8LaoZf2QYROcayVZ17MjKb0NN+7mnmGiuav6JXw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-20T16:52:21","subject":"Re: [PATCH] Fix PR79622","submitter":{"id":1765,"url":"http://patchwork.ozlabs.org/api/people/1765/","name":"Richard Biener","email":"richard.guenther@gmail.com"},"content":"On Tue, Sep 19, 2017 at 5:54 PM, Tamar Christina\n<Tamar.Christina@arm.com> wrote:\n> -- sorry for the duplicate, forgot to post to list as well first time --\n>\n> Hi Richard,\n>\n> The testcase seems to fail on aarch64-none-elf when -O1 or -O2,\n>\n> -O0, -Os and -O3 seem to work fine.\n>\n> dc[0] ends up being 0 for the cases that fail.\n\nWhat ISL version are you using?\n\nRichard.\n\n> Kind regards,\n> Tamar\n> ________________________________________\n> From: gcc-patches-owner@gcc.gnu.org <gcc-patches-owner@gcc.gnu.org> on behalf of Richard Biener <rguenther@suse.de>\n> Sent: Monday, September 18, 2017 8:31 AM\n> To: gcc-patches@gcc.gnu.org\n> Subject: [PATCH] Fix PR79622\n>\n> The following patch fixes the other known wrong-code bug in GRAPHITE\n> which shows we're mishandling PHIs in not properly considering the\n> edge copies they represent as living outside of the black-box we're\n> analyzing.\n>\n> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.\n>\n> Note the testcase still fails with ISL 0.16.1 but passes with 0.18\n> for me.  I'll update the version in download_prerequesites to 0.18.\n>\n> Richard.\n>\n> 2017-09-18  Richard Biener  <rguenther@suse.de>\n>\n>         PR tree-optimization/79622\n>         * graphite-scop-detection.c (build_cross_bb_scalars_def): Properly\n>         handle PHIs.\n>         (build_cross_bb_scalars_use): Likewise.\n>\n>         * gcc.dg/graphite/pr79622.c: New testcase.\n>\n> Index: gcc/graphite-scop-detection.c\n> ===================================================================\n> --- gcc/graphite-scop-detection.c       (revision 252806)\n> +++ gcc/graphite-scop-detection.c       (working copy)\n> @@ -1744,7 +1744,9 @@ build_cross_bb_scalars_def (scop_p scop,\n>    gimple *use_stmt;\n>    imm_use_iterator imm_iter;\n>    FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)\n> -    if (def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))\n> +    if ((def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))\n> +       /* PHIs have their effect at \"BBs\" on the edges.  See PR79622.  */\n> +       || gimple_code (SSA_NAME_DEF_STMT (def)) == GIMPLE_PHI)\n>        {\n>         writes->safe_push (def);\n>         DEBUG_PRINT (dp << \"Adding scalar write: \";\n> @@ -1758,7 +1760,8 @@ build_cross_bb_scalars_def (scop_p scop,\n>        }\n>  }\n>\n> -/* Record DEF if it is used in other bbs different than DEF_BB in the SCOP.  */\n> +/* Record USE if it is defined in other bbs different than USE_STMT\n> +   in the SCOP.  */\n>\n>  static void\n>  build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt,\n> @@ -1774,7 +1777,9 @@ build_cross_bb_scalars_use (scop_p scop,\n>      return;\n>\n>    gimple *def_stmt = SSA_NAME_DEF_STMT (use);\n> -  if (gimple_bb (def_stmt) != gimple_bb (use_stmt))\n> +  if (gimple_bb (def_stmt) != gimple_bb (use_stmt)\n> +      /* PHIs have their effect at \"BBs\" on the edges.  See PR79622.  */\n> +      || gimple_code (def_stmt) == GIMPLE_PHI)\n>      {\n>        DEBUG_PRINT (dp << \"Adding scalar read: \";\n>                    print_generic_expr (dump_file, use);\n> Index: gcc/testsuite/gcc.dg/graphite/pr79622.c\n> ===================================================================\n> --- gcc/testsuite/gcc.dg/graphite/pr79622.c     (nonexistent)\n> +++ gcc/testsuite/gcc.dg/graphite/pr79622.c     (working copy)\n> @@ -0,0 +1,26 @@\n> +/* { dg-do run } */\n> +/* { dg-options \"-O2 -floop-nest-optimize\" } */\n> +\n> +int bf;\n> +\n> +int\n> +main (void)\n> +{\n> +  int dc[5];\n> +\n> +  for (bf = 0; bf < 2; ++bf)\n> +    {\n> +      int l9, g5 = -1;\n> +\n> +      for (l9 = 0; l9 < 5; ++l9)\n> +       {\n> +         dc[l9] = g5;\n> +         g5 = (dc[l9] > 0);\n> +       }\n> +    }\n> +\n> +  if (dc[0] != -1)\n> +    __builtin_abort ();\n> +\n> +  return 0;\n> +}","headers":{"Return-Path":"<gcc-patches-return-462625-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462625-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"pC8KU5r8\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy5QN3HLSz9t2V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 02:52:44 +1000 (AEST)","(qmail 90750 invoked by alias); 20 Sep 2017 16:52:26 -0000","(qmail 90713 invoked by uid 89); 20 Sep 2017 16:52:26 -0000","from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com)\n\t(74.125.82.65) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tWed, 20 Sep 2017 16:52:24 +0000","by mail-wm0-f65.google.com with SMTP id m127so2982925wmm.0 for\n\t<gcc-patches@gcc.gnu.org>; Wed, 20 Sep 2017 09:52:23 -0700 (PDT)","by 10.80.143.34 with HTTP; Wed, 20 Sep 2017 09:52:21 -0700 (PDT)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:in-reply-to:references:from:date:message-id\n\t:subject:to:cc:content-type; q=dns; s=default; b=H1W5wLmoX9nb2zZ\n\tB9uhDbeHo46Igl9U+s/l5c4gEctuxSBbkJEF1k20n2CDTGlTNe/soCw/bo10FT45\n\tNbF/eA8nokCTqORqx8sqAqD2Zz5VDe/j8WzTSz5/oq4akZyJqGXKtBCUiGeHZcck\n\tRi7ve+QwX3/HwXetCgiP/9km3GCA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:in-reply-to:references:from:date:message-id\n\t:subject:to:cc:content-type; s=default; bh=LtrFNu/JtJIpLcljZZ3cF\n\tGuRD/0=; b=pC8KU5r8Xin16BJOTx4QH7Tfvi/opFA1dxhGLGs3CiDZvk6/kTmwg\n\tSYV5AQb0/uq+Rv5tMaekmW1zrHK2EaA/3eigXm1EoZO7d9LmZXEPQ3fWYW17aaRh\n\tXXtiq93r6QWj844Lb+ZG3W6pXmkHgdXv+8paUZoWvtV0d4vgfWaqsc=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-9.8 required=5.0 tests=AWL, BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mail-wm0-f65.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=GKFQoH7mK4n0XOUqXPla7EAM0ox6z7Wrtl+kH6gz/Uo=;\n\tb=WmWbDmQV6Wq+VmomTV3RmpdT3CUpx0TFQTLSv3iji0bnY0ctMa6H9ZNTjXFkgCiRkB\n\tP3WgTFj2yPMiQIWBy8jwBQZjzixQlu2h8ptdA+NB5WY30PBX6C49mB/8npkqQurQcBsK\n\tXuWNTZfdZqQfHDDRlBz8iNkyMcj9bMg8V9xM7hie7NkA/nK0Epk2w5pquAuT0z8Al5Tj\n\t7D83i0RvHMnMHxpFTEO3gzFzLqc1pF8A1XXLDXEkPkAeDRiGUxmXALQP+sVct5rAYv0f\n\tsIxHRxAAwSWqi2RAKGSfD7ewLPEcOAUlN2oM2vUqtI1Bk+BNGw/ArlLncPiHp719JTZm\n\tIvjw==","X-Gm-Message-State":"AHPjjUhiFySZNj90I667GtqUAs/U+mBvZE65xiWCVoz2UXfEcTq40VrZ\tCj9SnrCTWoJXQeWUE15W8ThcJVMvQQk0tkk4j7Q=","X-Google-Smtp-Source":"AOwi7QCvoW1FLhNu8uMQRcKeE0yuZ0B6WXv3rIEhL1AO0H103fVU5uXyG9ItYYflk0Nwfe9d7dNmwI6JweJsLq8OHwY=","X-Received":"by 10.80.137.39 with SMTP id e36mr5116937ede.182.1505926342120;\n\tWed, 20 Sep 2017 09:52:22 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<DB6PR0802MB23091A0E08F1A6292293EAAEFF600@DB6PR0802MB2309.eurprd08.prod.outlook.com>","References":"<alpine.LSU.2.20.1709180928410.26836@zhemvz.fhfr.qr>\n\t<DB6PR0802MB23091A0E08F1A6292293EAAEFF600@DB6PR0802MB2309.eurprd08.prod.outlook.com>","From":"Richard Biener <richard.guenther@gmail.com>","Date":"Wed, 20 Sep 2017 18:52:21 +0200","Message-ID":"<CAFiYyc22wDn8LaoZf2QYROcayVZ17MjKb0NN+7mnmGiuav6JXw@mail.gmail.com>","Subject":"Re: [PATCH] Fix PR79622","To":"Tamar Christina <Tamar.Christina@arm.com>","Cc":"Richard Biener <rguenther@suse.de>,\n\t\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-IsSubscribed":"yes"}},{"id":1772666,"web_url":"http://patchwork.ozlabs.org/comment/1772666/","msgid":"<DB6PR0802MB2309E82E9F2080278C8C985DFF660@DB6PR0802MB2309.eurprd08.prod.outlook.com>","list_archive_url":null,"date":"2017-09-21T10:39:23","subject":"RE: [PATCH] Fix PR79622","submitter":{"id":69689,"url":"http://patchwork.ozlabs.org/api/people/69689/","name":"Tamar Christina","email":"Tamar.Christina@arm.com"},"content":"> -----Original Message-----\r\n> From: Richard Biener [mailto:richard.guenther@gmail.com]\r\n> Sent: 20 September 2017 17:52\r\n> To: Tamar Christina\r\n> Cc: Richard Biener; gcc-patches@gcc.gnu.org; nd\r\n> Subject: Re: [PATCH] Fix PR79622\r\n> \r\n> On Tue, Sep 19, 2017 at 5:54 PM, Tamar Christina\r\n> <Tamar.Christina@arm.com> wrote:\r\n> > -- sorry for the duplicate, forgot to post to list as well first time\r\n> > --\r\n> >\r\n> > Hi Richard,\r\n> >\r\n> > The testcase seems to fail on aarch64-none-elf when -O1 or -O2,\r\n> >\r\n> > -O0, -Os and -O3 seem to work fine.\r\n> >\r\n> > dc[0] ends up being 0 for the cases that fail.\r\n> \r\n> What ISL version are you using?\r\n\r\nAh, it seems we had it set to 0.15.\r\n\r\nSorry for the noise,\r\nTamar\r\n\r\n> \r\n> Richard.\r\n> \r\n> > Kind regards,\r\n> > Tamar\r\n> > ________________________________________\r\n> > From: gcc-patches-owner@gcc.gnu.org <gcc-patches-owner@gcc.gnu.org>\r\n> on\r\n> > behalf of Richard Biener <rguenther@suse.de>\r\n> > Sent: Monday, September 18, 2017 8:31 AM\r\n> > To: gcc-patches@gcc.gnu.org\r\n> > Subject: [PATCH] Fix PR79622\r\n> >\r\n> > The following patch fixes the other known wrong-code bug in GRAPHITE\r\n> > which shows we're mishandling PHIs in not properly considering the\r\n> > edge copies they represent as living outside of the black-box we're\r\n> > analyzing.\r\n> >\r\n> > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.\r\n> >\r\n> > Note the testcase still fails with ISL 0.16.1 but passes with 0.18 for\r\n> > me.  I'll update the version in download_prerequesites to 0.18.\r\n> >\r\n> > Richard.\r\n> >\r\n> > 2017-09-18  Richard Biener  <rguenther@suse.de>\r\n> >\r\n> >         PR tree-optimization/79622\r\n> >         * graphite-scop-detection.c (build_cross_bb_scalars_def): Properly\r\n> >         handle PHIs.\r\n> >         (build_cross_bb_scalars_use): Likewise.\r\n> >\r\n> >         * gcc.dg/graphite/pr79622.c: New testcase.\r\n> >\r\n> > Index: gcc/graphite-scop-detection.c\r\n> >\r\n> ==========================================================\r\n> =========\r\n> > --- gcc/graphite-scop-detection.c       (revision 252806)\r\n> > +++ gcc/graphite-scop-detection.c       (working copy)\r\n> > @@ -1744,7 +1744,9 @@ build_cross_bb_scalars_def (scop_p scop,\r\n> >    gimple *use_stmt;\r\n> >    imm_use_iterator imm_iter;\r\n> >    FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)\r\n> > -    if (def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))\r\n> > +    if ((def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))\r\n> > +       /* PHIs have their effect at \"BBs\" on the edges.  See PR79622.  */\r\n> > +       || gimple_code (SSA_NAME_DEF_STMT (def)) == GIMPLE_PHI)\r\n> >        {\r\n> >         writes->safe_push (def);\r\n> >         DEBUG_PRINT (dp << \"Adding scalar write: \"; @@ -1758,7 +1760,8\r\n> > @@ build_cross_bb_scalars_def (scop_p scop,\r\n> >        }\r\n> >  }\r\n> >\r\n> > -/* Record DEF if it is used in other bbs different than DEF_BB in the\r\n> > SCOP.  */\r\n> > +/* Record USE if it is defined in other bbs different than USE_STMT\r\n> > +   in the SCOP.  */\r\n> >\r\n> >  static void\r\n> >  build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt,\r\n> > @@ -1774,7 +1777,9 @@ build_cross_bb_scalars_use (scop_p scop,\r\n> >      return;\r\n> >\r\n> >    gimple *def_stmt = SSA_NAME_DEF_STMT (use);\r\n> > -  if (gimple_bb (def_stmt) != gimple_bb (use_stmt))\r\n> > +  if (gimple_bb (def_stmt) != gimple_bb (use_stmt)\r\n> > +      /* PHIs have their effect at \"BBs\" on the edges.  See PR79622.  */\r\n> > +      || gimple_code (def_stmt) == GIMPLE_PHI)\r\n> >      {\r\n> >        DEBUG_PRINT (dp << \"Adding scalar read: \";\r\n> >                    print_generic_expr (dump_file, use);\r\n> > Index: gcc/testsuite/gcc.dg/graphite/pr79622.c\r\n> >\r\n> ==========================================================\r\n> =========\r\n> > --- gcc/testsuite/gcc.dg/graphite/pr79622.c     (nonexistent)\r\n> > +++ gcc/testsuite/gcc.dg/graphite/pr79622.c     (working copy)\r\n> > @@ -0,0 +1,26 @@\r\n> > +/* { dg-do run } */\r\n> > +/* { dg-options \"-O2 -floop-nest-optimize\" } */\r\n> > +\r\n> > +int bf;\r\n> > +\r\n> > +int\r\n> > +main (void)\r\n> > +{\r\n> > +  int dc[5];\r\n> > +\r\n> > +  for (bf = 0; bf < 2; ++bf)\r\n> > +    {\r\n> > +      int l9, g5 = -1;\r\n> > +\r\n> > +      for (l9 = 0; l9 < 5; ++l9)\r\n> > +       {\r\n> > +         dc[l9] = g5;\r\n> > +         g5 = (dc[l9] > 0);\r\n> > +       }\r\n> > +    }\r\n> > +\r\n> > +  if (dc[0] != -1)\r\n> > +    __builtin_abort ();\r\n> > +\r\n> > +  return 0;\r\n> > +}","headers":{"Return-Path":"<gcc-patches-return-462684-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462684-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"ey9jw6SK\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Tamar.Christina@arm.com; "],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyY5S4rBPz9s2G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 20:39:39 +1000 (AEST)","(qmail 96904 invoked by alias); 21 Sep 2017 10:39:30 -0000","(qmail 96183 invoked by uid 89); 21 Sep 2017 10:39:29 -0000","from mail-eopbgr40086.outbound.protection.outlook.com (HELO\n\tEUR03-DB5-obe.outbound.protection.outlook.com) (40.107.4.86)\n\tby sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with\n\tESMTP; Thu, 21 Sep 2017 10:39:26 +0000","from DB6PR0802MB2309.eurprd08.prod.outlook.com (10.172.228.13) by\n\tDB6PR0802MB2600.eurprd08.prod.outlook.com (10.172.252.17)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Thu, 21 Sep 2017 10:39:23 +0000","from DB6PR0802MB2309.eurprd08.prod.outlook.com\n\t([fe80::78a8:cb36:9798:56f]) by\n\tDB6PR0802MB2309.eurprd08.prod.outlook.com\n\t([fe80::78a8:cb36:9798:56f%17]) with mapi id 15.20.0077.011;\n\tThu, 21 Sep 2017 10:39:23 +0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:references:in-reply-to\n\t:content-type:content-transfer-encoding:mime-version; q=dns; s=\n\tdefault; b=HnJEcegezt/CNj5V7HaeD7Gdt4+M1HEs12krkR4qab+t8+1gonjvO\n\toTB/TV4boibStatuAJEF1MVVIB/dsc3TA70FLLDDN/tw4xcP2wbKIjg+eUHHWJN9\n\tW2ZoStMA891YUOVvj60UKtypzWWHR8iDMFkuJDz6CzNLqLHHi7O3gQ=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:references:in-reply-to\n\t:content-type:content-transfer-encoding:mime-version; s=default;\n\tbh=q0BmGFF9MYMZVT6ORYGP+v03rqI=; b=ey9jw6SKepEtY3v7t+3P/juQymk1\n\tyS+UlU33RK7EvY983XAZq+H/SkDyDIAnthohAk1Xm3EC+4Q8/jcKTorEQ6MBvNgI\n\tg8jQRVtMuSTF30BKeqKpRY11DO9USiBIpTd8LnZAurykOZO711pQdGmccNPCSNia\n\tLmpglN9S911yh1o=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-11.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tMIME_BASE64_BLANKS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=noise","X-HELO":"EUR03-DB5-obe.outbound.protection.outlook.com","From":"Tamar Christina <Tamar.Christina@arm.com>","To":"Richard Biener <richard.guenther@gmail.com>","CC":"Richard Biener <rguenther@suse.de>,\n\t\"gcc-patches@gcc.gnu.org\"\t<gcc-patches@gcc.gnu.org>, nd <nd@arm.com>","Subject":"RE: [PATCH] Fix PR79622","Date":"Thu, 21 Sep 2017 10:39:23 +0000","Message-ID":"<DB6PR0802MB2309E82E9F2080278C8C985DFF660@DB6PR0802MB2309.eurprd08.prod.outlook.com>","References":"<alpine.LSU.2.20.1709180928410.26836@zhemvz.fhfr.qr>\n\t<DB6PR0802MB23091A0E08F1A6292293EAAEFF600@DB6PR0802MB2309.eurprd08.prod.outlook.com>\n\t<CAFiYyc22wDn8LaoZf2QYROcayVZ17MjKb0NN+7mnmGiuav6JXw@mail.gmail.com>","In-Reply-To":"<CAFiYyc22wDn8LaoZf2QYROcayVZ17MjKb0NN+7mnmGiuav6JXw@mail.gmail.com>","authentication-results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462684-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"ey9jw6SK\"; dkim-atps=neutral","sourceware.org; auth=none","spf=none (sender IP is )\n\tsmtp.mailfrom=Tamar.Christina@arm.com; "],"x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; DB6PR0802MB2600;\n\t6:vpAXCSxoKdO33+ArLXcoX2ogjaAgqz1zoj9vK4Fm8dtQJ6uLRgdS0e5mQgCrXvEH/am12Uel4n0X6JT41EpgtPkJj614hlXgeaoxPShJbgJtQqsgHTpibNQEyJHQG/XtvL2oIl3MhRCeT4ntOfy6z8O9WKY/wPpOg5Iyo3v7+/bj5HBeNBncVjaq/aIdvhNJ/MxOln3EEGdpyrea8XpxRkuYQ/GyxELyFKP8TE2Gq1jyv4BRt0EtLwpLj+UjkMyddp8nSsEOl8tazOIW3F8lEBOjvnivv8u7smDekbp8iufCTTsyS7urO6nlc9ZI02STSOu+BRF0gMRit89szJ907A==;\n\t5:Hh/yfUijaiiTiYzxsx8k1ZBX+Hv/gRQinv0a+nUgVrt/Li8IZU9b0UHQIA8F5nXwp92bXx70/36n7Zib6bp+6fuXPp3ZarcjlXEN9yKDbSZg8HAvfWVI9n6nuHGxoLUSGYBFSQRcKFmLtCBB5Eg74g==;\n\t24:PlduUqx+zk3C+o0KP3arpP1xZdwbl2qIkSynlRsi/A8vCJC82nj2R+i7btbzgoRtoKIYxyW7/nn3A8H5HGmOrGOvf0ukK5x6ah88Q0HlNaI=;\n\t7:BgEsNC63iA180y8ZkHB9HghRQwwO8BmeVYCh0rCmWoPCTwsimcChR6J0rA8l9diqU3/WKpQ8XpUKnNJ35BIdylVU3mSZ9le8SSQJEXCbJHfGJMGYkpq8w3+m+WNT1FONn9Bvj2CnNZrpDpyMsCEwclvUFMljFV562r8xlmeIL+dGbwoZ2JDKm1vNwJpn60/S8+Y3p9Vy0cIMto+QKlawo6WONokhlFH+OzqYPo45Zm8=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"f99ead61-908e-4014-cb6e-08d500dd0633","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB6PR0802MB2600; ","x-ms-traffictypediagnostic":"DB6PR0802MB2600:","nodisclaimer":"True","x-exchange-antispam-report-test":"UriScan:(180628864354917)(22074186197030)(183786458502308); ","x-microsoft-antispam-prvs":"<DB6PR0802MB2600779E157919E42D9F043AFF660@DB6PR0802MB2600.eurprd08.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB6PR0802MB2600; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB6PR0802MB2600; ","x-forefront-prvs":"04371797A5","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(376002)(346002)(39860400002)(377424004)(189002)(199003)(24454002)(377454003)(13464003)(14454004)(106356001)(7696004)(3280700002)(66066001)(33656002)(3660700001)(39060400002)(2950100002)(6916009)(189998001)(50986999)(8676002)(76176999)(8936002)(316002)(54906003)(81166006)(81156014)(7736002)(5660300001)(97736004)(74316002)(68736007)(101416001)(5250100002)(54356999)(305945005)(53936002)(86362001)(102836003)(3846002)(25786009)(6116002)(478600001)(6506006)(6246003)(105586002)(72206003)(55016002)(99286003)(2906002)(6436002)(9686003)(229853002)(2900100001)(53546010)(4326008);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2600;\n\tH:DB6PR0802MB2309.eurprd08.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","received-spf":"None (protection.outlook.com: arm.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","MIME-Version":"1.0","X-OriginatorOrg":"arm.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"21 Sep 2017 10:39:23.3217\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"f34e5979-57d9-4aaa-ad4d-b122a662184d","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB6PR0802MB2600","X-IsSubscribed":"yes"}}]