From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 503C93853781 for ; Thu, 8 Dec 2022 22:36:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 503C93853781 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIfXv002818; Thu, 8 Dec 2022 22:36:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : references : date : in-reply-to : message-id : content-type : mime-version; s=corp-2022-7-12; bh=pvXqYU6rDBBSxsNMAwH71iOf+MV+UsBYMV1l2Dy5yTI=; b=WguDB3gmpHgGo68bA5BtOV748mOVCTxofdKTEUCV8z5NSwlnrE84IMvYpi66vxgL0wvO fOwD2QqaCjHXH3VIXpmVfKuRiwBx9z1uszUdZG5Mlf5Q8hUFSzTQIOCdCiMLL78qNlMJ FWjSi+StMyrRpbr9Fnn+DnriHTHGZJXrYctpOA1ZIHKoLI8B0LLbIj89n6XkHs7jBJNi RcqCir4d2B1uP1/o6ZaViUaxiZRNv6Vjfftg3dIra06omrtetumruCpFb2uS6RKpSxDP nRaRfpjZX4n0dMpL6AF+l0FxuPTYoT5pVjWsRyQSPT7flZ/eh/fT0MpurL96fvInD0gr Mg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maudkc49w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Dec 2022 22:36:27 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B8Lk7qO034451; Thu, 8 Dec 2022 22:36:26 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa4stbg3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Dec 2022 22:36:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U82srkkoLZNl8Vmbkg1ZBrO7CsM3v/mqIvwfDp5iGsqxahIWencv4nWfx29uuclAM3CRRmzQhsSTGm9DO0UfMwjLLq98cyWKf0gDgGej1kyc8MrQTA0ZWqQOK6O8u/OUV8uapTYL4yRXHPB0mZxAOOCOQ0/QnGqwFeu9uc6Xp7Mx/E9Iz3WThMqyDVAQe506en3/cD7vtYY+ruzTLFZU8m1RjJ54URV1hzH5VUesHVAggpXReA3XvuJIqx024fo+m8vxLBc5uBGxBtXxEvhmPzKkn+bsvXdy8W56IPo8i6nkXW/bj174RmhES4yMjMww/Q6tW/R/+V+xNonEwetVyw== 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=pvXqYU6rDBBSxsNMAwH71iOf+MV+UsBYMV1l2Dy5yTI=; b=GwsFT/PhCrXSqr2djva5kbnrYnp01Yv4nLynSeob3ifpDf6myf0NQx8szn3qO3i1y9aYX1gTHQ00njBN4SjkXZjRa90kxpjkcVuxnq4AijQ4DumRxALiT0Jhr1GwIktv/M4oH8XVt3lDA0Nr1sXiLfae9PlgkBzW9UwfhOHv2jpfY+Muzu+Y7zXlKgSDVUEV/dIwQAGHYp9JX1qMvNkMSK8T9CBowGSGUEMtOdQhlgcAG+iB69Sn7d7mJ2jBM+/CRlZoy9GWM6Yj32qa4VG1kEqPX2lNls1z9fdkcBRTmEjkxgjBSF1LHZJLkZ6p7uRYUuuCAS0k2Ljs8f7yTdbdGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pvXqYU6rDBBSxsNMAwH71iOf+MV+UsBYMV1l2Dy5yTI=; b=IpB3BvGpxBm0Vke6zVUhscSVWS84jITuMfYFlhGz48bNmpJz055vmbPKoMcir6TVq20SJ6OVyAo0ADX1T9aO7DB5DioqtBK3HnOUb/CDI4RhlhRVodo8/X9HI2VpcG/VheziRXUAO6WKt/qHpn1WoXV+OxT6G1oVwke5G1IxOac= Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by BLAPR10MB5089.namprd10.prod.outlook.com (2603:10b6:208:330::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Thu, 8 Dec 2022 22:36:23 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::ebe9:b7c9:82ae:d256]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::ebe9:b7c9:82ae:d256%7]) with mapi id 15.20.5880.014; Thu, 8 Dec 2022 22:36:23 +0000 From: "Jose E. Marchesi" To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, david.faust@oracle.com Subject: Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization References: <20221208105944.660323-1-jose.marchesi@oracle.com> <87y1rixd3n.fsf@oracle.com> Date: Thu, 08 Dec 2022 23:40:07 +0100 In-Reply-To: (Jakub Jelinek's message of "Thu, 8 Dec 2022 14:19:01 +0100") Message-ID: <87cz8ttt88.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-ClientProxiedBy: LO4P123CA0065.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:153::16) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2888:EE_|BLAPR10MB5089:EE_ X-MS-Office365-Filtering-Correlation-Id: c9a8eeb5-865b-4cb0-ac0a-08dad96ca27b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E1R7TzDjSmGR6g/KfN1COspZo32GLsV5GyMWxrxZkMjgQhN3UExLN39pkfuRq/eqLA1OM8RZ9YEuLPKM5MgPUWoJpkCHJiTPS7USl3AM2bLiU9dNbz/TxujavXzS1otJnHa3XRHv33UGDhJ+5yI4P8mp0Ty2ujCxsDeUkkFpf9XbRVhQvw+oQ68JmHLYjucJgS4bDgx/l/rAqgCufsRPkhUD44XuJOxnhaSvfGVuRcf92g9Dfzc/E1poWNMr42Fp6aKCpDtp6uzDI/EGeyr6BKFwCrUandhu4S0EMVo+Yw373IubsNyGV4byNEXrfhBM4yx21BB21BuIGJ+3fVH4G+Kf1Kh1QDRTvsYo73oLwNoyj/AMx2VpLG7YgvCaFkyyv5KDUI01FY3nT7GpT4w5a+lz0msJlSNN8BGdjG5dIOkMbEPqGvDaAkt70OIv+7dGu6XMc/GjOYhRympI5w4jM16J08erT5qJn/BOq2OOFm9VF7f/a58N5morWN3c1M6cIdVkWIBV5RMP7wHNDxxBOpGaficxMVpZa7znuy29dSDaGbn5Kh8zgznRvAp4IOpmQAF5fe+gBpMg3WanrCLedQtp+KoTjrWgfD9F1tmoR0mEvqxqJ6ucxNVqLCu9KbcvZYwhN2j4rqkn/GS06JUucow4I667e5A1nMazOoN47vKZ/x9o1BsCXbrhR7STKNDRG0v3K0rbyh3SeZUU/OCEEQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB2888.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(376002)(346002)(396003)(136003)(39860400002)(451199015)(66899015)(36756003)(45080400002)(6916009)(8936002)(66476007)(4326008)(66946007)(2906002)(66556008)(8676002)(38100700002)(86362001)(83380400001)(41300700001)(2616005)(107886003)(316002)(478600001)(6486002)(6666004)(6512007)(5660300002)(186003)(6506007)(26005)(56340200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?p0ASdZbtYpXKx0vyQv/hB4jBStk2OiIKdfoBPB42YcTQmID6LWEoh9dl+9WV?= =?us-ascii?Q?baqzk9kDoVsUhk4+/H1lg69Om4lfTnHwePyklp06MnZW18ziz2mt1o1XLbeQ?= =?us-ascii?Q?MQKC3caHDC9AqXOreyzrQz/3UZd6Q+KqgdcJVdfLyVNgrTuPxFMOpxWPMAeK?= =?us-ascii?Q?o3CQdtLk7yYIj4KP9T7wF1q/jvt+732Vs/1yyh0/qJe2fxw4WkRbDstVVsU7?= =?us-ascii?Q?EC/Kf+pGHWQVQRC2VLM5KHjBwpdxImR92oPUTYJuJKp21C7rHocufS6IE29n?= =?us-ascii?Q?eVFiiGr5LZWtdpL865ashIFdU26BpwSdt3wHgjSx8cSevtyk825nRRrypbGV?= =?us-ascii?Q?02BuynImwENn1Rod9C3hEroM6CkEeZ9LU5gnalZtIbyBwVUrZpV969sBFbkI?= =?us-ascii?Q?ldFZyptUGPv5Uec3yIM3ts00vdaWpDOsKQd+WgJjDAfdEPpFg5WSaJ4j38Et?= =?us-ascii?Q?v53rgw7XcsvK6JYGQSvwfQOR2AvF4jHaeea3ysA7pnpoc6Ke4xLAgHUBTbTH?= =?us-ascii?Q?51mE3eB2/DXJMnnaBe7u6k0UYTqQAzzhf9IQW0Amxobeka3ilhD48JJezSAz?= =?us-ascii?Q?dRRY/x4nvOlpek5MdBbGYhdPJdLIBIHB+ipzM0SakXHzrYjy0TYZdWxSDvLH?= =?us-ascii?Q?KnqGJ1XPlsfFtQkclq/gMwtK/C4VfaErCjO+BgUtw5d2YPMwMEHXhuMRgNhQ?= =?us-ascii?Q?Ie2qDSAFxlyXcujDr91e9b00WlZPGoYXpdAOr5MxAg+0OlhVQGHinH5mQAHN?= =?us-ascii?Q?lQX2aioxAh8QzwcCT+N7K3fyWL903SEsIiCJEsYlQicm2rf+dFzcN1QjmFuD?= =?us-ascii?Q?UrhhuxugG6uy9Tji/ZujEZahdv7rxndckF/F+vWKSWl2WjOVkSIThGtyxMtE?= =?us-ascii?Q?1+N1bPn/kStUGp++tLd8am/zCkIzzpLW3gQ+W7W8udmr1opAJiEXJIa0/GCj?= =?us-ascii?Q?3himuXSoRVwkGUf8YNhdl3bFg92o24ycS9tWH4Ebc6jmiIj3L8GqoFpwpLg/?= =?us-ascii?Q?Ma7p8mGitbIv9Z8epnOKJieeiG7Bno20iJhdc7gh82qWJGfuw6ILpz+esl5+?= =?us-ascii?Q?xljN3CGZs7E1wlvoO4nvYHUs6Td3c4WDQzGmPcBnnvoDrAosDRarb4MlNg6q?= =?us-ascii?Q?J2tkNrKsqsPPwcpx/T9nZYg80OXlzxrAO1tvWqCfOdMrG85FwU3v5gX6Wl+V?= =?us-ascii?Q?dtJyr9dDVSkz4dxO8GC6Y6y0xVjqR0kBY7Otob/+FM1xP/T552bK9uKjx8KJ?= =?us-ascii?Q?9vtXk+Q0AWau80FVbOYgWpVO+a3sgkzDgkrv41SB9BxPniCCldQDJsepvwnd?= =?us-ascii?Q?MIUJKVsJN4safLqKkG2PVej5stbmXjrnDlYSvy4iZYT3fWpJ9HrJXk5YS9fG?= =?us-ascii?Q?vzz3Vo+YJ5yUfttErgBObmubIISq3uh+sLFynXTZ961NqEVD+CEq8bl8pWKK?= =?us-ascii?Q?4sD/r3uPAFaXym90WkWFxAiTSVSNPmbl1Ql1GpOhsZB9MnCWZR5VRIY2eGYL?= =?us-ascii?Q?XgfILktOO3nmG7tmR/nVy9Mbs5krm4XFXoWRYeZvWdxURH8/HIVktP2dhMCM?= =?us-ascii?Q?NeU9uKeDWosAFbTfr0NqpNZ6mjZwNfJMtmPxknMceijPRa6QQnt3IVR+1QoK?= =?us-ascii?Q?hA=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9a8eeb5-865b-4cb0-ac0a-08dad96ca27b X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 22:36:23.5336 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RXUGEZAT32I1gHn0NY5msV4Wd5ezEwb5UQkFVXm031BjVSZpsQpFr6WGjhUU6Wdg1pr0jsfROjzQ5HOw52m0k3yncRGYTpgQfz9CvKfnrcg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5089 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-08_12,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212080186 X-Proofpoint-GUID: cnd1IrxosksNDXLjHkZejXBIAFNoxcG7 X-Proofpoint-ORIG-GUID: cnd1IrxosksNDXLjHkZejXBIAFNoxcG7 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Jakub. > On Thu, Dec 08, 2022 at 02:02:36PM +0100, Jose E. Marchesi wrote: >> So, I guess the right fix would be to call assemble_external_libcall >> during final? The `.global FOO' directive would be generated >> immediately before the call sequence, but I guess that would be ok. > > During final only if all the targets can deal with the effects of > assemble_external_libcall being done in the middle of emitting assembly > for the function. > > Otherwise, it could be e.g. done in the first loop of shorten_branches. > > Note, in calls.cc it is done only for emit_library_call_value_1 > and not for emit_call_1, so if we do it late, we need to be able to find > out what call is to a libcall and what is to a normal call. If there is > no way to differentiate it right now, perhaps we need some flag somewhere, > say on a SYMBOL_REF. And then assemble_external_libcall either only > if such a SYMBOL_REF appears in CALL_INSN or sibcall JUMP_INSN, or > perhaps anywhere in the function and its constant pool. Allright, the quick-and-dirty patch below seems to DTRT with simple examples. First, when libcalls are generated. Note only one .global is generated for all calls, and actually it is around the same position than before: $ cat foo.c int foo(unsigned int len, int flag) { if (flag) return (((long)len) * 234 / 5); return (((long)len) * 2 / 5); } $ cc1 -O2 foo.c $ cat foo.c .file "foo.c" .text .global __divdi3 .align 3 .global foo .type foo, @function foo: mov32 %r1,%r1 lsh %r2,32 jne %r2,0,.L5 mov %r2,5 lsh %r1,1 call __divdi3 lsh %r0,32 arsh %r0,32 exit .L5: mov %r2,5 mul %r1,234 call __divdi3 lsh %r0,32 arsh %r0,32 exit .size foo, .-foo .ident "GCC: (GNU) 13.0.0 20221207 (experimental)" Second, when libcalls are tried by expand_moddiv in a sequence, but then discarded and not linked in the main sequence: $ cat foo.c int foo(unsigned int len, int flag) { if (flag) return (((long)len) * 234 / 5); return (((long)len) * 2 / 5); } $ cc1 -O2 foo.c $ cat foo.c .file "foo.c" .text .align 3 .global foo .type foo, @function foo: mov32 %r0,%r1 lsh %r2,32 jne %r2,0,.L5 add %r0,%r0 div %r0,5 lsh %r0,32 arsh %r0,32 exit .L5: mul %r0,234 div %r0,5 lsh %r0,32 arsh %r0,32 exit .size foo, .-foo .ident "GCC: (GNU) 13.0.0 20221207 (experimental)" Note the .global now is not generated, as desired. As you can see below, I am adding a new RTX flag `is_libcall', with written form "/l". Before I get into serious testing etc, can you please confirm whether this is the right approach or not? In particular, I am a little bit concerned about the expectation I am using that the target of the `call' instruction emitted by emit_call_1 is always a (MEM (SYMBOL_REF ...)) when it is passed a SYMBOL_REF as the first argument (`fun' in emit_library_call_value_1). Thanks. diff --git a/gcc/calls.cc b/gcc/calls.cc index 6dd6f73e978..6c4a3725272 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -4370,10 +4370,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, || argvec[i].partial != 0) update_stack_alignment_for_call (&argvec[i].locate); - /* If this machine requires an external definition for library - functions, write one out. */ - assemble_external_libcall (fun); - original_args_size = args_size; args_size.constant = (aligned_upper_bound (args_size.constant + stack_pointer_delta, @@ -4717,6 +4713,9 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, valreg, old_inhibit_defer_pop + 1, call_fusage, flags, args_so_far); + /* Mark the emitted call as a libcall with the new flag. */ + RTL_LIBCALL_P (last_call_insn ()) = 1; + if (flag_ipa_ra) { rtx datum = orgfun; diff --git a/gcc/final.cc b/gcc/final.cc index eea572238f6..df57de5afd0 100644 --- a/gcc/final.cc +++ b/gcc/final.cc @@ -815,6 +815,8 @@ make_pass_compute_alignments (gcc::context *ctxt) reorg.cc, since the branch splitting exposes new instructions with delay slots. */ +static rtx call_from_call_insn (rtx_call_insn *insn); + void shorten_branches (rtx_insn *first) { @@ -850,6 +852,24 @@ shorten_branches (rtx_insn *first) for (insn = get_insns (), i = 1; insn; insn = NEXT_INSN (insn)) { INSN_SHUID (insn) = i++; + + /* If this is a `call' instruction that implements a libcall, + and this machine requires an external definition for library + functions, write one out. */ + if (CALL_P (insn) && RTL_LIBCALL_P (insn)) + { + rtx nested_call = call_from_call_insn (safe_as_a (insn)); + rtx mem = XEXP (nested_call, 0); + gcc_assert (GET_CODE (mem) == MEM); + rtx fun = XEXP (mem, 0); + gcc_assert (GET_CODE (fun) == SYMBOL_REF); + assemble_external_libcall (fun); + + /* Clear the LIBCALL flag to make sure we don't assemble the + external definition more than once. */ + RTL_LIBCALL_P (insn) = 0; + } + if (INSN_P (insn)) continue; diff --git a/gcc/print-rtl.cc b/gcc/print-rtl.cc index e115f987173..26a06511619 100644 --- a/gcc/print-rtl.cc +++ b/gcc/print-rtl.cc @@ -882,6 +882,9 @@ rtx_writer::print_rtx (const_rtx in_rtx) if (RTX_FLAG (in_rtx, return_val)) fputs ("/i", m_outfile); + if (RTX_FLAG (in_rtx, is_libcall)) + fputs ("/l", m_outfile); + /* Print REG_NOTE names for EXPR_LIST and INSN_LIST. */ if ((GET_CODE (in_rtx) == EXPR_LIST || GET_CODE (in_rtx) == INSN_LIST diff --git a/gcc/read-rtl.cc b/gcc/read-rtl.cc index 62c7895af60..eb0ae150a5b 100644 --- a/gcc/read-rtl.cc +++ b/gcc/read-rtl.cc @@ -1543,6 +1543,9 @@ read_flags (rtx return_rtx) case 'i': RTX_FLAG (return_rtx, return_val) = 1; break; + case 'l': + RTX_FLAG (return_rtx, is_libcall) = 1; + break; default: fatal_with_file_and_line ("unrecognized flag: `%c'", flag_char); } diff --git a/gcc/rtl.h b/gcc/rtl.h index 7a8c4709257..92c802d3876 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -401,6 +401,10 @@ struct GTY((desc("0"), tag("0"), Dumped as "/i" in RTL dumps. */ unsigned return_val : 1; + /* 1 in a CALL_INSN if it is a libcall. + Dumped as "/l" in RTL dumps. */ + unsigned is_libcall : 1; + union { /* The final union field is aligned to 64 bits on LP64 hosts, giving a 32-bit gap after the fields above. We optimize the @@ -1578,6 +1582,10 @@ jump_table_for_label (const rtx_code_label *label) #define RTL_PURE_CALL_P(RTX) \ (RTL_FLAG_CHECK1 ("RTL_PURE_CALL_P", (RTX), CALL_INSN)->return_val) +/* 1 if RTX is a libcall. */ +#define RTL_LIBCALL_P(RTX) \ + (RTL_FLAG_CHECK1 ("RTL_LIBCALL_P", (RTX), CALL_INSN)->is_libcall) + /* 1 if RTX is a call to a const or pure function. */ #define RTL_CONST_OR_PURE_CALL_P(RTX) \ (RTL_CONST_CALL_P (RTX) || RTL_PURE_CALL_P (RTX))