From patchwork Tue Dec 19 09:19:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 1877810 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=S3npovo7; 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=S3npovo7; 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 4SvWPk5Nmsz1ydg for ; Tue, 19 Dec 2023 20:20:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79EDE3857348 for ; Tue, 19 Dec 2023 09:20:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2049.outbound.protection.outlook.com [40.107.15.49]) by sourceware.org (Postfix) with ESMTPS id 712463858D38 for ; Tue, 19 Dec 2023 09:20:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 712463858D38 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 712463858D38 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.49 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1702977613; cv=pass; b=lqecrcIA+Vvp9xo12eQFVzfxbKmZI6o2zCVo7Oo8XdHP0wI4tEb0AetxHyzTHZ30ZCpQzENZZVcoUxOfWP4JmZBnncm/AJaJQ5ySqPR8J8yLi2d3slyEI87CisC3cdlaxWmoGW+v5Qh/E/6aIpOVu0BVkIF5EMGypgiwLu+azyU= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1702977613; c=relaxed/simple; bh=pDG2zexQQGRTN2WUeuOa1NjJ89EApfbubTIOhtPLo/o=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=clDwVpSz4ccvJzE/SxfpS8LmfqriGdGDCxLu1AS72f9+/MMB/P6RKSX4oozDqKtwlCTMzt2faUaT3oP0WE94Ra9ZYcC2BVkwJiW5VE81LDXdevVtGaLQs/9y4F9su1HvI4sG8F20dzTFOT8sJKy+/VZSLo7/O+EYhzpwR428Zb4= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=eURRGVh3PPSBPqfgvqNbvwG323OJYm/N1fU2W/OKh0j/QOeWDIE6Iw/l+J9TlxX2KRjNJEmLuR3OY3/zFjndV9k85UNQTqvlM2p8J/SwQx3Owjs/b2dlMJ4rMzLOuXw8kegpN/T9hldW0YcujYBJ761tsB9luWFaYdK0FcjbSwTmHJICzQWQ86h9rVZr6grIesvOrBDZR+8I6Jgz4pfd5JYPrcTxAQpVcbHKHyzyi+kWYHaldZmCeY2xuAW79+an+oH64iu6zmL5G4U2ylhWtnMJq21xnMme+roJAmKBxVwuXKgzGlYrJafDzF7bvZ3vklzzm9D5Aqf6HeXZOqZdfg== 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=YqxWb5rDg0/edT60d6V+g5Q+0myw3DdUMQ/XG6PphnY=; b=e5OhkpbbRmyVGr1/vqkZVAzY9mgln+5A8fiFnF/I/Uyx4Nvfbw+pZkbrzYEsqFABM2KrIO1KPDkI8WvxKQEG8ltbAOV2xc4Yortn0FI1Ag6DeEJumXpShZ97+RtWwsLOnNy7QaCfWyD/+8B1QAe5/V4Dn/4q0NUcCiA/NzdhBeN29xO4bfAhQ/yQ5RtIuWAGKoWOdVbzmkgrWALatS4JQDzjium5RWWG+kg3SSjBiW8A3ZshpRRRs8FgW9pIfs/tF6vxxPZwtWVX7bfGQmc+FJZpaCeCEd6YwRwG0XvC3HBvv9WCaYYRanMYK248gZxb2diEBp0dax4X4C1EV5BtQA== 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=YqxWb5rDg0/edT60d6V+g5Q+0myw3DdUMQ/XG6PphnY=; b=S3npovo7sucLgHYiC83GZl4MD4KndUroabEcPj12ZId3ltuoYiv6aXCSv7A4+0jD/D4hq61nh+pzSMtT4m9BcCLBQU4eVdbW2kJiJOZFBZ6fzWyuM0b2DL661qXZ9l8O67PblWB4ryGS9f3dW/Z4bKinrZSiMvYeCzy0SMO2QuA= Received: from AM6P195CA0023.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::36) by PAVPR08MB9859.eurprd08.prod.outlook.com (2603:10a6:102:30f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28; Tue, 19 Dec 2023 09:20:06 +0000 Received: from AMS0EPF000001AB.eurprd05.prod.outlook.com (2603:10a6:209:81:cafe::59) by AM6P195CA0023.outlook.office365.com (2603:10a6:209:81::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38 via Frontend Transport; Tue, 19 Dec 2023 09:20:06 +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 AMS0EPF000001AB.mail.protection.outlook.com (10.167.16.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.14 via Frontend Transport; Tue, 19 Dec 2023 09:20:06 +0000 Received: ("Tessian outbound 8289ea11ec17:v228"); Tue, 19 Dec 2023 09:20:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6a0ae63e63503957 X-CR-MTA-TID: 64aa7808 Received: from 8ba72a998673.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AA0F33D3-712A-423D-84C5-C8A2FB1580B5.1; Tue, 19 Dec 2023 09:19:59 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8ba72a998673.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 19 Dec 2023 09:19:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FiLISGdaEf91yuz5SIIgt6wo3IKdJjyqBeQ0ZwUq9ebeEwsX4ZtHsMgBhNlasXc8XD4UQ8D81vTjMv0NH9rHc+aN9Jm0eznDiIut25vEHQLmwuvLKzoD6unJGCAbWMwh3al75cybNThPQ3FcPYQ0hI427ZDEkkoJVI3TxTK8UCk56Ok0rXKNeeoKp3qzdspaCAIZEgk8uApI0ckxEvqGpLMnhIX3T00HukP4PmnYy9XW6qKAO92deNkWPgFYqwX7sIJZOVGHoi6xoor1Q+r8gc4YSHlekOfs/eIa+Zd6y/VyXXERrWIain7S+iIlKiZXZ5V4Me6/zcI6cdjVA/690A== 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=YqxWb5rDg0/edT60d6V+g5Q+0myw3DdUMQ/XG6PphnY=; b=Y0k6tC+k0WJLHZeZzpnF5hVOu2ougV0mkDLgC0GuVcROyyjF9VcVM1qaub1gMXnVLcSdRGFWr3JvW6wrIzOmxkULfJdgf8den8CUf/sNPKSPsGOm4xQV/tBksVjoFeLHlhszAMo+/M2sdfJunXB12dKBY00wQJEJ+BxeWnqGDhD6p/7xdfUXtoCi3z4YIEI8sI7L+1NTTEvBFzxd1RH6wL97Qc2QkVabQ2MBEPGqb6S6c+rSfJG9YBZn4V9YOlGkKN6n8vN1kppb0zJoxkpfG32Ye/9B8cWSI3MvIRXuZb1gXFDDukQVCkqRKUazgiCobMbXI2IxlWH0rbFRKeIhOw== 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=YqxWb5rDg0/edT60d6V+g5Q+0myw3DdUMQ/XG6PphnY=; b=S3npovo7sucLgHYiC83GZl4MD4KndUroabEcPj12ZId3ltuoYiv6aXCSv7A4+0jD/D4hq61nh+pzSMtT4m9BcCLBQU4eVdbW2kJiJOZFBZ6fzWyuM0b2DL661qXZ9l8O67PblWB4ryGS9f3dW/Z4bKinrZSiMvYeCzy0SMO2QuA= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) by DB8PR08MB5434.eurprd08.prod.outlook.com (2603:10a6:10:116::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Tue, 19 Dec 2023 09:19:55 +0000 Received: from PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::8512:cc10:24d4:1919]) by PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::8512:cc10:24d4:1919%5]) with mapi id 15.20.7091.034; Tue, 19 Dec 2023 09:19:55 +0000 Date: Tue, 19 Dec 2023 09:19:51 +0000 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Subject: [PATCH] aarch64: Validate register operands early in ldp fusion pass [PR113062] Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P265CA0295.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:38f::8) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|DB8PR08MB5434:EE_|AMS0EPF000001AB:EE_|PAVPR08MB9859:EE_ X-MS-Office365-Filtering-Correlation-Id: fa247809-a79a-40c2-d628-08dc0073b0cb 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: yWfMwNTal6qXA7pMjZuBjMr/w5V3NTcTgrV4Ftdn4HK2GqI9P88enp4ryn5heWMv0K/QI4tT2ArzN1JhUEmKgTgWuEi48VdRYY+2Z0ltaz/qw9GOiETJOqn8wZNhJb8DGLStqSmwffcrXNPQj+1RNbShb0WeTz8KoON6S8uoTQsKNOFo2fizs6fqD11BGNj8w2X4ElBn49/2uPLVqROs/Z2Rj4pc42LyJYg8vIyV4OQnY1JnXb4Q+ph+3tP3H2hU6//PeVKJcVj5ybOEiIXgUCnC79rqNLfZwVbhcu4v0qhN3eIZ4Kyrlet3DjEonIdgfLlfbVAfNht8SlxJQqRAL+7ttxMrA4bHu2Ftlj9dEd41qAMPO3LhDG8pW6hQlvt6ej83wbDvD/1/APdnBHx6ugk6Mbd2HBi5a36phJAdiqsMgJ3YLNR3HrNWhTujrz76gyHCj/bqFoY2Okq7rYLabVBqh4p80jl6hBtKVFLfkprZJea/38zmTriPQ9r78ht1JI1mrNsU/vDL+IGoxD0Po3u7nlOhVeMgTkR3SHhlEQ1xiZlDwtDQsvLdpisrj2l/LyPdY27+OR4/EtmGXf8VD7ewdBy0jw4vuJtVefly0bc= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8958.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(346002)(376002)(136003)(396003)(366004)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(235185007)(8936002)(8676002)(6666004)(84970400001)(2906002)(44832011)(5660300002)(6512007)(44144004)(33964004)(38100700002)(4326008)(6916009)(66556008)(83380400001)(316002)(66946007)(54906003)(21480400003)(66476007)(41300700001)(478600001)(6486002)(26005)(6506007)(86362001)(2616005)(36756003)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5434 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: AMS0EPF000001AB.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 38512d5b-3506-4ff4-1173-08dc0073a9d5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DNb+pk2O5Ph4750QomP0uWaNSlAniGNCsyzLihDaMHf906C63nCO/EUUYiyaVhbz68dOGZTyXKGOQQZmoZSzZFNXwryc9N6fkUdWBswSjOXgGw6U+VKUGJuY+6z9LauE4s5PvaqaCwWYPMH1cx4GsCTs2suj+2BmxknXOfVhlNuGnP4qZ7YjTGxSN3Cs8JT54auKy6b7PRFTQte9v4e2A6hPHWdQD4sS9pmabUZ14fsytvLgqjQClgrl2jzM/8dvYBcVqxfE5ZwDaCFv2XkSZ07cSz2vkn0LHcajvaL0yQhtn1NC8MacOdO6wa0dBXHol7biekT0EpuL6YsW0+CGDzAs3JX8p4j8f6IdXI7+QGNeEdk1EcP4ysVpwKwvboYow89lYCF1QxWGlRSCe/sUtccsUnM5t1sHA0IgjNSTyU1gpA/oasyDUGQ7yVIaNn5UNF3sW/cEdNPV4LYg/o7LLQ6SfMEP5rDNVXCYv9hiEn9uBae0+dEY32xDz/wO9S4x8yilcJZiAC3Y/91fJ9zOvQa0mICrfXfpI+wP/RLJkyz5TxbAuqP5rtynwHVC50FOzLw0BTWXLnrc5VaxC3zjHY6woEW4sY+VjAlU4xGgGKkoEoiAu3OO5y/qJrmQEFdDy4MSHIxK+JAQ2zrIcN8faMq133vzNGMljxB/Kos+hulZ7Y5Qb9BUW1Ja1Pb1wnVyOkrwHLVV0rjkYOg29blS0fsVjFH7EvH16CqUkZzCe41yWmr46oGkTx0/Qc4gojlr 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)(39860400002)(346002)(376002)(396003)(136003)(230922051799003)(82310400011)(186009)(64100799003)(451199024)(1800799012)(40470700004)(36840700001)(46966006)(2906002)(47076005)(336012)(5660300002)(235185007)(83380400001)(6486002)(478600001)(6666004)(26005)(4326008)(44832011)(8936002)(21480400003)(8676002)(36860700001)(84970400001)(40480700001)(2616005)(356005)(82740400003)(44144004)(33964004)(6506007)(6916009)(54906003)(316002)(70206006)(70586007)(6512007)(41300700001)(81166007)(36756003)(40460700003)(86362001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 09:20:06.6530 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa247809-a79a-40c2-d628-08dc0073b0cb 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: AMS0EPF000001AB.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9859 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, LIKELY_SPAM_BODY, 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 We were missing validation of the candidate register operands in the ldp/stp pass. I was relying on recog rejecting such cases when we formed the final pair insn, but the testcase shows that with -fharden-conditionals we attempt to combine two insns with asm_operands, both containing mem rtxes. This then trips the assert: gcc_assert (change->new_uses.is_valid ()); in the stp case as we aren't expecting to have (distinct) uses of mem in the candidate stores. Bootstrapped/regtested on aarch64-linux-gnu, OK for trunk? Thanks, Alex gcc/ChangeLog: PR target/113062 * config/aarch64/aarch64-ldp-fusion.cc (ldp_bb_info::track_access): Punt on accesses with invalid register operands. gcc/testsuite/ChangeLog: PR target/113062 * gcc.dg/pr113062.c: New test. diff --git a/gcc/config/aarch64/aarch64-ldp-fusion.cc b/gcc/config/aarch64/aarch64-ldp-fusion.cc index 327ba4e417d..273db8c582f 100644 --- a/gcc/config/aarch64/aarch64-ldp-fusion.cc +++ b/gcc/config/aarch64/aarch64-ldp-fusion.cc @@ -476,6 +476,12 @@ ldp_bb_info::track_access (insn_info *insn, bool load_p, rtx mem) const lfs_fields lfs = { load_p, fpsimd_op_p, mem_size }; + // Ignore the access if the register operand isn't suitable for ldp/stp. + if (!REG_P (reg_op) + && !SUBREG_P (reg_op) + && (load_p || !aarch64_const_zero_rtx_p (reg_op))) + return; + if (track_via_mem_expr (insn, mem, lfs)) return; diff --git a/gcc/testsuite/gcc.dg/pr113062.c b/gcc/testsuite/gcc.dg/pr113062.c new file mode 100644 index 00000000000..5667c17b0f6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr113062.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-Oz -fharden-conditional-branches" } */ +long double foo; +double bar; +void abort(); +void check() { + if (foo == bar) + abort(); +} +