From patchwork Mon Dec 11 10:22:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1874433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=8BX1Ux20; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=8BX1Ux20; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Spd9X5twXz20Gw for ; Mon, 11 Dec 2023 21:22:56 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B56593858414 for ; Mon, 11 Dec 2023 10:22:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2058.outbound.protection.outlook.com [40.107.249.58]) by sourceware.org (Postfix) with ESMTPS id DFDE83858D33 for ; Mon, 11 Dec 2023 10:22:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFDE83858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DFDE83858D33 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.249.58 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1702290161; cv=pass; b=W35wQd0vPMOyG7rx4frAPlYIeO8Z+BsSuPawRyMwW8/ixvGtjmVFFicA+u3m/u8xwGkFIHcKLcRqTnHjQ9cjylC82PEMWUG2iIZTifb+Yw5XlcJrbD6AKAuBzMvlMCNPQ2eIFwinmJmykcYKjimSoKR2d1Enid1Zx0v7oDVzOTE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1702290161; c=relaxed/simple; bh=CUyQX6EFfiXRm7qUDgZs7IH7WSkJr7ue2dK1u0HA0yg=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=ZDM1WmQoadqFK2CCZzkxtfxKQzpB9u7dGnVK0Ncvr2i4wd77+EgdDT7wkOILC6QIk38N7M16pD62tJ5dhiYlQAGw4gGU2p+Nc8VeSTem/5ZEWzoXqRuuKTRGRiSbqHWC6hLomViMWcdAHs7SwRzTxuj00Ki0GjkgClUw1qzMKBY= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=bWkpNe0gtFYD9FWPcyaUvHuUGiPRr9SdSEszvfRu+uSzNjdp/tqNpq4lNgMTe3V4zg+NY4rmKgYT+wgRUb69vxjOEu76aq59TlgjEpp90fSNBk4FSF2TCAaOlyw81Gg0f64nCrhI20JzjkscU0LUM9SDSBCkWGWZQUoIcqYUb5UsT1LMvAAWciKCnUCynp8T37p7s+XVVg3n1Wl/OMddbX6NIo1g8WQIrGWuppHJZXKHgCLGPwAxzzx9QQv72t9eQa1I46YO0Y6lPLlSZoPOWZpb9rdLPYFM3me5NUnHXoxZVEXHKVmP5EzBCN8ck7N7q5vrDV4dxqaE4zuqlOVmtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+uSFhNgBBMhGFU6b7nY3tbbtBXpnqQGYCYDQJ45WF9M=; b=cDPMrIkMc+q55qN5z4+VsPQHpEqh2dT4r/kD3H3jXnRjIuNLJvaneK0Pq4ljgyoNxneIVqpJZ3sniUCh82FCZyFmZhAc+bkmCaAF9RIZthDcjL0AhZNEwgla8/vT370sntA28H1MPxC3pBuqh+AivGZE/bMtHJb/v/jO3e746JmKZLorRLbNR+bvL6VVqlWiNSNDkXOjIoQgOVtknvI7fhAKS9PkR96HiiihnKYFGqiFThB87rOrIdLogwOHkO7H99lAHCFil3sJ9O/7EBZJmEQg6gVPi2KbzIxtxa1KUIOsyS9rgbuRARhFWfSbVj5oeMuEJFASjx+xCE8glQT8fA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+uSFhNgBBMhGFU6b7nY3tbbtBXpnqQGYCYDQJ45WF9M=; b=8BX1Ux20FPx7YInjc2qin6127Vkn77uo2aRw4XX/ws4vIGGOziVaOJmPdJNqOw+dyftsyqZyewM+k8aOPr30gJZVXT+D+4ymvLWe99FGLYZwECoFSNPLzjBjNryUL8O2FA50pcn4FDeelKe9gmt4ntzgc7HVND5bJfGB35dYf88= Received: from AM6PR05CA0023.eurprd05.prod.outlook.com (2603:10a6:20b:2e::36) by DU2PR08MB7341.eurprd08.prod.outlook.com (2603:10a6:10:2f0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:22:21 +0000 Received: from AM2PEPF0001C716.eurprd05.prod.outlook.com (2603:10a6:20b:2e:cafe::ad) by AM6PR05CA0023.outlook.office365.com (2603:10a6:20b:2e::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 10:22:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM2PEPF0001C716.mail.protection.outlook.com (10.167.16.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:22:21 +0000 Received: ("Tessian outbound 20615a7e7970:v228"); Mon, 11 Dec 2023 10:22:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6f65be1ef5fb0a5a X-CR-MTA-TID: 64aa7808 Received: from 71f7a82d8aa7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4981D43F-B422-444A-A406-C2C46BD6AB9B.1; Mon, 11 Dec 2023 10:22:14 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 71f7a82d8aa7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 11 Dec 2023 10:22:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OyzNzU5H+AoOCa6l0UfnrTD3olWk64y5BCEuJ5uj6oce8jwzcAc1ak7mLsCSLQUQmFwT8KKGPrRP5OvlnXT+ZvMcfGUx2SXuH1UkbUUJ5BtA0DPrUpyMMIB1kddaBQvIgtdkbZbZiD0NjnZS5mnwHeaJd4ARcECsQ1UYRLsdadBHDNuwYg6xXq3x/ezAcbgd1U6bxWOB89JV4O7mW+QU+rkUwhYn54AeJQ5S9357/mCt2d8BpGQqgs0YydZ4fQtJG7YRPzg8xgMeaa7gw7FM8Xklp7CmtTI7rg/IHRCTZ8hLshY+QftRhcm43Kvd9vjckbujNcYN1KhXBUfr2EWc5Q== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+uSFhNgBBMhGFU6b7nY3tbbtBXpnqQGYCYDQJ45WF9M=; b=MGiLhMgQmLorpPok2a4BAfGjUYP5eNGNbZY6le342WVL4rEp2Xg2GRLa0JAcZ39xYA7setMOELalizc9cJtFYJJtupLic+ghzVrr5tZTjmwKO26hmMmkA6xq9SS/XAoNz+hjjYHrCd4z0HXiI7rKnaLtP7D8LIa02RugAjhsUQJQ+l7o3eLqv447VWgg2RTi4mxsQ1od4SH6AgYkn1JsVGP6FprkD9iJfyn5Eykw7p7O/rb5bHJ8StH1eKN3mp8PUNi6IpZ0hwgHlI5nQoNnKjS2o6eyAeQbyWAFwVhy3q9hTXRo/VoFvKx004gLrNWFSzTT2n3SMfKX4Y4saXqDug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+uSFhNgBBMhGFU6b7nY3tbbtBXpnqQGYCYDQJ45WF9M=; b=8BX1Ux20FPx7YInjc2qin6127Vkn77uo2aRw4XX/ws4vIGGOziVaOJmPdJNqOw+dyftsyqZyewM+k8aOPr30gJZVXT+D+4ymvLWe99FGLYZwECoFSNPLzjBjNryUL8O2FA50pcn4FDeelKe9gmt4ntzgc7HVND5bJfGB35dYf88= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by DB9PR08MB7447.eurprd08.prod.outlook.com (2603:10a6:10:36d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:22:07 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::9679:2ab0:99c6:54a3]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::9679:2ab0:99c6:54a3%6]) with mapi id 15.20.7068.031; Mon, 11 Dec 2023 10:22:07 +0000 Date: Mon, 11 Dec 2023 10:22:05 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH]middle-end: Mark all control flow as used_in_scope. Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P302CA0029.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::20) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|DB9PR08MB7447:EE_|AM2PEPF0001C716:EE_|DU2PR08MB7341:EE_ X-MS-Office365-Filtering-Correlation-Id: dc15582e-a890-4a40-e136-08dbfa330fc9 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vifV6dk6m+dK6JQKbJ/dsFzHpFc0SkC4pMYzcqXKAHytoGIyOndtL/D3j94Ttemk90sN5ZT3zA2QaBO+sIQH8saRWkxpaNz8bUKgAATydiwPZJ6Foh7AxqV49LIrU7VqLsJwwiGB8QkccoRbSmEv98z/NN5+25mgIBn9MgEZ0rKxgsv/Bx4Jdgz/SmpasXsKxysXQqriV2baFSf2aj7iyGJg/U6qGaxXuxfzu7Sf+j//pFY4l1mgIPHeRK4UYLl3JOBNjP40W52hPf9cQiSI+/evBOEPHpg4tnB+fAOjEFW6wOltQMnPyznyWYIbWO2N5iQjokbFeYv729p5w02QCestSPjSJ065266qzW8JxuTra85QNjsG0U62BBXrUpB6jbDNqysdBYwBopInjKoVXuI/lmg2PudOigAIrr7ZuLZAsH7m6SDfrvdCyPiVfg4yMDQ484W7mblQdHDM6kZ2CkegG9/lZjbHFI9EQsGXksx/ReO9RjaMKOJTqaPOpf37VgjPrP4uLy/Iv326sW9DuZaKCH6JIhRSpglO0BMzFvwilL4Ml6WSBEIe6ocrxrnmkzz8phcUYTfupR1u6b9jaajYYGU9ZkLi+Xp3py1Iu/x/zigyfQm2d2om8u1AU+P2 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(396003)(39860400002)(136003)(346002)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(2906002)(478600001)(41300700001)(66556008)(66476007)(6916009)(66946007)(6486002)(84970400001)(316002)(38100700002)(86362001)(44144004)(4326008)(8936002)(8676002)(33964004)(6506007)(6512007)(44832011)(36756003)(5660300002)(235185007)(26005)(2616005)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7447 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C716.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9048a3f4-2a32-4c2a-4229-08dbfa33073d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wrl4c7mwJ8JsdeEKvqAJ+ZeSYyio3bm8CfIFKOh6eB7D5ksakL9vKpUZ3heDINNaHHA0vhzi35UfcB5Pk0sHlIrbcSfOzk6mPBbqEY2Gxa3s8mEP+lDpkTZ1L7Dz/TlRDueQxjjuoacqHtj9TnIA4yiN5zt/+TFCqm7Cu21anDXTXtzoCNTJXGVL0dWyIUcThLaErLnzVW2zVbKU0VaAt2EcTnZ2fkY8HTMjSVA3/eQDR9TpeVbRwKsewYFrsABJF5YQiEfbvPz00Oxm2OSqyHMxpO4JGQ9GSDxZ+XIcbX1yl2J3N27UdjI9IG8gBswtBqkn3YAS08TWSXNJdRacLBFGMP1DVe6fTxSgq0QDs8mOuQXOlc/HMUROZgWZ76bcV8c2qrHYjJTPzGetqGz4Z6fKnwyJ+UTDVkdPu2o0rnC00J/HWPYxu3k3NHO7s+rT9TzqxgYDTF5ObRImnp4Vz2WbmRRxgrjlxtMjil5KPhsaH7BIv64i86W4+u3zHbEFG9PgT+tKFAH6P/t03vk0eLX2sZQe+6RZCSiXQpCxHkhd3Wdy5yRjMQ+6EKklnBdUofi19XWVwb9CQiC7u+4TGM9vrYm3BfyTeGFpA/A/Ky2I/Gsr3TfsN4qM+7gPjI2Xcl+1AZBdpAMnPYO1CwfybdiFyUpjbxpVdydAl5gsJZemISjnS+a6epddR8i79oeU++ioKuZY60OVJuujzPlQbtMCDt2kTXPAhhevj6h74YAJL7/Y+099oKVh2NPRgYFg X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(39850400004)(346002)(376002)(396003)(230922051799003)(64100799003)(451199024)(82310400011)(1800799012)(186009)(36840700001)(46966006)(40480700001)(84970400001)(41300700001)(235185007)(2906002)(5660300002)(44832011)(316002)(4326008)(6916009)(8936002)(8676002)(70586007)(70206006)(356005)(82740400003)(2616005)(86362001)(36756003)(36860700001)(81166007)(47076005)(6486002)(26005)(478600001)(336012)(6512007)(107886003)(44144004)(33964004)(6506007)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:22:21.7753 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc15582e-a890-4a40-e136-08dbfa330fc9 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C716.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB7341 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi All, While compiling SPECCPU 2017 I ran accross the reason (I had forgotten) why my initial patch marked all control statements as used in scope and not just gconds: There are other statements that can introduce multiple exits, like switch statements. If we ignore them as not relevant we never get a chance to reject them later as not vectorizable. Becuase they are marked as not relevant we crash or produce invalid code. The fix is to mark all control statements as used in scope, and then we later reject them as not vectorizable. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-stmts.cc (vect_stmt_relevant_p): Mark all control flow as used in scope. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-early-break_89.c: New test. --- inline copy of patch -- diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_89.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_89.c new file mode 100644 index 0000000000000000000000000000000000000000..d33f3d94c096ffc53e4e82a28c3db058633fb21d --- diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_89.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_89.c new file mode 100644 index 0000000000000000000000000000000000000000..d33f3d94c096ffc53e4e82a28c3db058633fb21d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_89.c @@ -0,0 +1,18 @@ +/* { dg-require-effective-target vect_int } */ + +char *a; +extern void d(); +void b() { + int c = 0; + while (c < 16) { + switch (a[c]) { + case '"': + case '\'': + c++; + continue; + } + break; + } + if (c) + d(); +} diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 72f271658e357bd562eb29087735825eb5ab0dc0..98704b7cea8a93f5beae7a55c85085c049e54152 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -361,7 +361,7 @@ vect_stmt_relevant_p (stmt_vec_info stmt_info, loop_vec_info loop_vinfo, /* cond stmt other than loop exit cond. */ gimple *stmt = STMT_VINFO_STMT (stmt_info); - if (is_a (stmt) + if (is_ctrl_stmt (stmt) && LOOP_VINFO_LOOP_IV_COND (loop_vinfo) != stmt && (!loop->inner || gimple_bb (stmt)->loop_father == loop)) *relevant = vect_used_in_scope; --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_89.c @@ -0,0 +1,18 @@ +/* { dg-require-effective-target vect_int } */ + +char *a; +extern void d(); +void b() { + int c = 0; + while (c < 16) { + switch (a[c]) { + case '"': + case '\'': + c++; + continue; + } + break; + } + if (c) + d(); +} diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 72f271658e357bd562eb29087735825eb5ab0dc0..98704b7cea8a93f5beae7a55c85085c049e54152 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -361,7 +361,7 @@ vect_stmt_relevant_p (stmt_vec_info stmt_info, loop_vec_info loop_vinfo, /* cond stmt other than loop exit cond. */ gimple *stmt = STMT_VINFO_STMT (stmt_info); - if (is_a (stmt) + if (is_ctrl_stmt (stmt) && LOOP_VINFO_LOOP_IV_COND (loop_vinfo) != stmt && (!loop->inner || gimple_bb (stmt)->loop_father == loop)) *relevant = vect_used_in_scope;