From patchwork Thu Oct 19 13:26:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Cheng X-Patchwork-Id: 828089 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-464536-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="S6zXp/ga"; 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 3yHqT91PLwz9t0F for ; Fri, 20 Oct 2017 00:26:35 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; q=dns; s=default; b=F8Wy15/LYjTbiSffidxcllsEuIxKf5/X76Gq+8CsqkcjPFIj8S uIzQJx6w26lXIcOE1I2zMx9qveyzZrFA1s2pWtxJnN+jA/ET6fFUEgV916zbE8oI 28y95BsFyYT52/Kpke524AQHc1+5mwQo2aOSbKIXDpJUoTtzZe1CxEg9Y= 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:from :to:cc:subject:date:message-id:content-type:mime-version; s= default; bh=EZNEgv4b6qaO0+3g7BygiL7NDVs=; b=S6zXp/ga511tk4ZE+EsT HcYUWK14mQFinmw4z2hZSgHjLMeB8BMxggp+TeZX0kWSmJMDoPOBBDPYMKR6CREb l++m5mJrKbZGuOebOVkjtK1x3P2+zxoLhryI99K2F/xrXEagJlObP2qcmtq7N5Fd n2DpN/aPqoqyfeFz+tQpDII= Received: (qmail 63234 invoked by alias); 19 Oct 2017 13:26:27 -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 63223 invoked by uid 89); 19 Oct 2017 13:26:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0085.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Oct 2017 13:26:25 +0000 Received: from DB5PR0801MB2742.eurprd08.prod.outlook.com (10.166.176.26) by DB5PR0801MB2742.eurprd08.prod.outlook.com (10.166.176.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 13:26:22 +0000 Received: from DB5PR0801MB2742.eurprd08.prod.outlook.com ([10.166.176.26]) by DB5PR0801MB2742.eurprd08.prod.outlook.com ([10.166.176.26]) with mapi id 15.20.0077.022; Thu, 19 Oct 2017 13:26:22 +0000 From: Bin Cheng To: "gcc-patches@gcc.gnu.org" CC: nd Subject: [PATCH GCC][1/3]Simplify (A + CST cmp A -> CST cmp zero) for undefined overflow type Date: Thu, 19 Oct 2017 13:26:22 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bin.Cheng@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR0801MB2742; 6:hgdJJr1N8o0/Vso3uqh1cLIFTdmdxguAFAmkyVTGrfxFFMPbm0WE1KD7+B/6CLR6srI/gG5mb5hwTqKTVzRQ35sF0mxzKempGUhln+pqhGD9xJcHniKPrcXWCp0r25QstUKhvwjMqGnIIw+XLiABRn8e5QFcG/mL12OpXw93JhikFNbnzAWDUlnZPSjVeiNdcefKjvYpbmu7VnISVg5nPrm8iHh0DqzAh2lFtu1YkwCVj/g14zSraXH78aKVnWd+3l/9L9mFwWP2VFsYxXkJ86ffuvieCc3fxWIhgCx4NVjYGUFwzMbV8bckxkWj71SL/50UOGX0zO+a5iXKZLE2tQ==; 5:98Jccenr2lOG+0G/vFe6GA6OK7L6JQmvIQQ+ZDmYmO/jUK1h42rexLcnYEr2mBsblNyO3MlRILIzNmbf5KHIf1XPxhNBKHBfaVd62IgaqSNq41YamDejOf4CwggENKgzI//Wf9ZfzwRH2hIk8/XqxA==; 24:k9zsXtZyz3dTvQOVae1VdpWixrln1+zPx8FezPQS+9qePHeWThUh60+xekDMDTP6mocWsho+AzvwCkFMieTM2uN604moHVk+YhOQacCXn5w=; 7:g+Nvdc53zHyr9HTqsQCftU7ZqvDkCdM/MAY5RlJOCM43mPWSpYIaN48qi8/LhWSei4GoO3O5fZudYTCfsBhWX3kdXOt0Mmmfv7EsaC0A5+qRTkyKOucvUYrtzhOtAy3rnAZBVH2F0t6hHobkNJF7LEBcOPtVObI/Lgx891hB788S0Fvph48F3ZuPHk3BQfwKKo4QfAzfe6vVafMZHvuNXp7Z9GaIH5I77ap0nds7LOo= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 866d97f1-29da-43ef-25a0-08d516f4fd79 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:DB5PR0801MB2742; x-ms-traffictypediagnostic: DB5PR0801MB2742: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917)(22074186197030)(183786458502308); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB5PR0801MB2742; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5PR0801MB2742; x-forefront-prvs: 0465429B7F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(377424004)(189002)(199003)(6436002)(305945005)(97736004)(7696004)(5640700003)(3660700001)(2351001)(55016002)(9686003)(99286003)(8676002)(101416001)(5660300001)(6916009)(6306002)(66066001)(2501003)(77096006)(6506006)(68736007)(189998001)(33656002)(74316002)(54356999)(86362001)(25786009)(2900100001)(3280700002)(4001150100001)(106356001)(72206003)(2906002)(7736002)(81156014)(4326008)(102836003)(316002)(50986999)(6116002)(53936002)(3846002)(8936002)(99936001)(14454004)(81166006)(966005)(478600001)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0801MB2742; H:DB5PR0801MB2742.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2017 13:26:22.2574 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0801MB2742 X-IsSubscribed: yes Hi, This is a rework of patch set at https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01036.html and https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01037.html. The patch set improves niters bound analysis for split loop. Instead of feeding bound computation to generic folder, this patch simplifies (A + CST cmp A -> CST cmp zero) for types with undefined overflow behavior. Bootstrap and test for patch set on x86_64 and AArch64. Comments? Thanks, bin 2017-10-16 Bin Cheng * match.pd (A + CST cmp A -> CST cmp zero): New simplification for undefined overflow types in (A + CST CMP A -> A CMP' CST'). From 9eb5d484235b97ed6e4e5f153dd7f159d7365f38 Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Mon, 16 Oct 2017 14:24:10 +0100 Subject: [PATCH 1/3] simplify-AopCst-cmp-A-20171006.txt --- gcc/match.pd | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index f2c4373..64b023d 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3518,7 +3518,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* When one argument is a constant, overflow detection can be simplified. Currently restricted to single use so as not to interfere too much with ADD_OVERFLOW detection in tree-ssa-math-opts.c. - A + CST CMP A -> A CMP' CST' */ + A + CST CMP A -> A CMP' CST' + + For type with undefined overflow behavior, the expression can also be + simplified by assuming overflow won't happen. + A + CST cmp A -> CST cmp zero. */ (for cmp (lt le ge gt) out (gt gt le le) (simplify @@ -3530,7 +3534,18 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (with { unsigned int prec = TYPE_PRECISION (TREE_TYPE (@0)); } (out @0 { wide_int_to_tree (TREE_TYPE (@0), wi::max_value (prec, UNSIGNED) - - wi::to_wide (@1)); }))))) + - wi::to_wide (@1)); })) + (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0))) + (with + { + tree zero = build_zero_cst (TREE_TYPE (@1)); + + fold_overflow_warning (("assuming signed overflow does not occur " + "when simplifying A + CST cmp A"), + WARN_STRICT_OVERFLOW_CONDITIONAL); + } + (cmp @1 { zero; })))))) /* To detect overflow in unsigned A - B, A < B is simpler than A - B > A. However, the detection logic for SUB_OVERFLOW in tree-ssa-math-opts.c -- 1.9.1 From patchwork Thu Oct 19 13:26:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Cheng X-Patchwork-Id: 828090 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-464537-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mbHfLEQJ"; 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 3yHqTM4qr6z9t42 for ; Fri, 20 Oct 2017 00:26:47 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; q=dns; s=default; b=G27omXzD/k1rKk3XD68XXai2Z72MRmr6wLbIvoCOhnlIOJSf+f 80PiZjYJmQQ8DlAzMj4XIFuqubVIThI5pPpy6z3PlTg90y8dHiAT5gepYzwW9GKO Bt9RrBoRC5sPlJH8axzzuPYYaidXHOA5WLdGXDqVSVgCAY3uzPUKVx0uA= 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:from :to:cc:subject:date:message-id:content-type:mime-version; s= default; bh=oxvRpyxXOEXUJzxWcMFnn5kILtg=; b=mbHfLEQJC8HPzzt40i33 QtOgGsHubrvs9ASPdepUtZYhCKAZMy1VsoTTWhVN8gnShk7yytSg1mR59ay7D80j aotvW8xyY71jxFa9t+vJapB/iiOg01ACrgYiZFPV7HvCaOnmHMDmTaUG7/6VxY/A kqIDZddawN4PuQ38nOOHbGI= Received: (qmail 63796 invoked by alias); 19 Oct 2017 13:26:32 -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 63579 invoked by uid 89); 19 Oct 2017 13:26:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0085.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Oct 2017 13:26:28 +0000 Received: from DB5PR0801MB2742.eurprd08.prod.outlook.com (10.166.176.26) by DB5PR0801MB2742.eurprd08.prod.outlook.com (10.166.176.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 13:26:26 +0000 Received: from DB5PR0801MB2742.eurprd08.prod.outlook.com ([10.166.176.26]) by DB5PR0801MB2742.eurprd08.prod.outlook.com ([10.166.176.26]) with mapi id 15.20.0077.022; Thu, 19 Oct 2017 13:26:26 +0000 From: Bin Cheng To: "gcc-patches@gcc.gnu.org" CC: nd Subject: [PATCH GCC][2/3]Simplify ((A +- CST1 CMP A +- CST2)) for undefined overflow type Date: Thu, 19 Oct 2017 13:26:26 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bin.Cheng@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR0801MB2742; 6:O+9VUJpBMGL0hH4ry+apHtta1N4VZ6QXmlyM4r0f4IhlZDPcqGMfxOS1EIynlE7RprQelh3EApnI+u26K4ObJtx++uN/MBqrJ3wxegZK4e7Og0/2FVW4JkpalODfon9Cz6DuIhuTdjLiyANDj7Vues70t0gG+i5C9f+EsqdV3UM/+Z0rh8GWfQ+HWY9w9J7Ve6WI7PXNQUxmcb85vTVPus29RJwrMesWNUe/jMY4g95t0yia2Ix4iNCHBJNkyMX54joDnGlPRNHaT8mx5grZ1TtbUA+nmCGkquVKpBUJL7j8w3ibdGvj4pd6ToUF/7S/233en2VUq73bRilaxqWihg==; 5:sJe0BLGZJTnHPvbJ8FHfccnA4WmW7GDdWRJrl6WwCpDMqzmNNa+kvyryuntLwCj37HwC6vTj4fF16PKWmKzuFQL9H22Bi0j1KXAG03ns9xglnygjm6RAAcGnLHI8BaMoh4AAyQwoYBS+lfF9kChR3Q==; 24:mEb/LB5wqGhMSVIvQ2yIOv0g+bI9ZaqSc1GjfqPWOS5T5X5WmeKldg7kXnI+0TUwJcuk+yOrbGRbAIPFa8zHFkeJaNaMt4K59Ztyy8B799w=; 7:UPjK+6Vl5PHXsBrodF8QPoMCv9zMq8LtVaLA856oVYjlbN4+jxFfWIxq+M1uTeGSQzVZQSOPeWsl+wdxF51hg98sPy2uXZsYXXJC640T3lGlItIwVxcMfTbKC2X9bx/YmPW1+AcYNMXl9rFKnJl8fuggNotqu3lDDxr8vrmix4ynJtfI+t86nW+H2bVzkBeyFHyzerNfP3H/SoDW/knxVuedRGhuIsMPG18TuWOlAJc= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: a9ea2f6c-6372-448b-37a7-08d516f5000b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:DB5PR0801MB2742; x-ms-traffictypediagnostic: DB5PR0801MB2742: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB5PR0801MB2742; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5PR0801MB2742; x-forefront-prvs: 0465429B7F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(377424004)(189002)(199003)(6436002)(305945005)(97736004)(7696004)(5640700003)(3660700001)(2351001)(55016002)(9686003)(99286003)(8676002)(101416001)(5660300001)(6916009)(66066001)(2501003)(77096006)(6506006)(68736007)(558084003)(189998001)(33656002)(74316002)(54356999)(86362001)(25786009)(2900100001)(3280700002)(4001150100001)(106356001)(72206003)(2906002)(7736002)(81156014)(4326008)(102836003)(316002)(50986999)(6116002)(53936002)(3846002)(8936002)(99936001)(14454004)(81166006)(478600001)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0801MB2742; H:DB5PR0801MB2742.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2017 13:26:26.5858 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0801MB2742 X-IsSubscribed: yes Hi, This patch adds pattern simplifying (A +- CST1 CMP A +- CST2) for undefined overflow types. Bootstrap and test for patch set on x86_64 and AArch64. Comments? Thanks, bin 2017-10-16 Bin Cheng * match.pd (A +- CST1 CMP A +- CST2): New pattern. From 6e31cde6560366242c15039a5b3032f5425750e0 Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Thu, 10 Aug 2017 17:29:22 +0100 Subject: [PATCH 2/3] simplify-AopCst1-cmp-AopCst2-20170806.txt --- gcc/match.pd | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gcc/match.pd b/gcc/match.pd index 64b023d..dae0f1c 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3485,7 +3485,30 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (cmp == LE_EXPR) (ge (convert:st @0) { build_zero_cst (st); }) (lt (convert:st @0) { build_zero_cst (st); })))))))))) - + +/* A +- CST1 CMP A +- CST2 in type with undefined overflow behavior. */ +(for cmp (lt gt le ge) + (for xop (plus minus) + (for yop (plus minus) + (simplify + (cmp (xop @0 INTEGER_CST@1) (yop @0 INTEGER_CST@2)) + (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0)) + && types_compatible_p (TREE_TYPE (@1), TREE_TYPE (@2))) + (with + { + tree cst1 = @1, cst2 = @2, zero = build_zero_cst (TREE_TYPE (@1)); + if (xop == MINUS_EXPR) + cst1 = int_const_binop (MINUS_EXPR, zero, cst1); + if (yop == MINUS_EXPR) + cst2 = int_const_binop (MINUS_EXPR, zero, cst2); + + fold_overflow_warning (("assuming signed overflow does not occur " + "when simplifying A +- CST cmp A +- CST"), + WARN_STRICT_OVERFLOW_CONDITIONAL); + } + (cmp { cst1; } { cst2; }))))))) + (for cmp (unordered ordered unlt unle ungt unge uneq ltgt) /* If the second operand is NaN, the result is constant. */ (simplify -- 1.9.1