From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2051.outbound.protection.outlook.com [40.107.247.51]) by sourceware.org (Postfix) with ESMTPS id 0BE6A3858D39 for ; Fri, 26 May 2023 07:11:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BE6A3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cwJaU47rObiPEvVa+Sqp5hmMrN1LJ110j1XInhlXC6LMxYSXJYEhWFqY83SHJCkWOpmHLtfJq6DgO97uZwUPZNntprT7cZdCmiV93d2797ujrSxpWbxl5yTdU9SrcwBy98DRh35kamDtZUgrxkSdZUAFnrT9rhYbuRGOnu2Wis2MvF+tALbYYTS29Rv804b5CM4ntVSEP35/YeHpvS8PUJlKvurpWG/bjXD0OwaaR1Cx/foSHpblc7y97zZrOnmryP+Ekqw4KeG1Gbdg4xSp8rZek8mmjyhtfOqUrBk/EnoB8V3VtotqkcYge5gpCYuiTEuFOqWVGx4rPJ3jvGsWww== 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=NnSGZG0AWf1n7FxWtaMbNfdwcI//ubtnaBGFSQAei4k=; b=Q5oYUa53AO4pB2/dIq5eF6DsSyNHMOi+ImdInSiB6ZbME+0+sJYtYOAMDZZrmB69J0hjfwl3u6x504y+WpjI8NadOKZmxqtr3pE4STbiipoLs1DcJed7lrckf4RmI7Ic5OA2aQKQ+svHkVgbHxGw4ReLKkSd27gedFCc2KLeFJ+jai4c5UY5gzds0FWOTP80fG3tueIV5zIex6AHLLW5VBnvP19V1si8aLrn7Xaki48Qn9PYBnEmUDMKDmeTIJCCHtdTl2onnc1UMNZBGfbIu6vT099pcfJcSv0Guu4NcCR6LwhYl6dt6D3oIXbENSsBJBCuGSne0E1Iu16pzYr5Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NnSGZG0AWf1n7FxWtaMbNfdwcI//ubtnaBGFSQAei4k=; b=cEoAqrTUJh2DEXnwzSFiPREaCJk+eFcLyOa/b/WM4WnTKY1K/bMHFtveIDw4J++8Aa0pvjTGbrTPh3scVHhs1Ld46KRYItdAsi7qkYNoZ1Zn65/JtAS8ifLvK97RADHIjTzCcrQSZj2CiCzeXBlrJqFX1JhUp1YID2tJxbDbTm23IkzbuSK6gEno1VIeSAbnZElk1m8X4eLz4cv3lV35q0vOd/XvlPPRaYvGu0hQwdIpPT4puqMNn9n2TXq2T8GucuM40TY9ig/zGFx7giJ/ghEi1yFI+9jxpS/IhqLNuBEykFitFkDfHW5OfWY9w46U4Q4On6jmgD1imDEFdaY4zw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PAWPR04MB9742.eurprd04.prod.outlook.com (2603:10a6:102:389::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15; Fri, 26 May 2023 07:11:54 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::e442:306f:7711:e24c]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::e442:306f:7711:e24c%5]) with mapi id 15.20.6433.016; Fri, 26 May 2023 07:11:54 +0000 Message-ID: <9527a604-788a-a17f-2102-8466e3f7a209@suse.com> Date: Fri, 26 May 2023 09:11:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] i386: Allow -mlarge-data-threshold with -mcmodel=large Content-Language: en-US To: Fangrui Song Cc: gcc-patches@gcc.gnu.org, Florian Weimer , "H.J. Lu" , Jan Hubicka , Michael Matz , Uros Bizjak References: <20230525151632.3567825-1-maskray@google.com> <7a627f23-a603-a6cf-90bd-0cd430e7232f@suse.com> <20230525161157.yixwnjqfed56zedw@google.com> From: Jan Beulich In-Reply-To: <20230525161157.yixwnjqfed56zedw@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0085.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9b::12) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|PAWPR04MB9742:EE_ X-MS-Office365-Filtering-Correlation-Id: cef1748f-b01c-4ef5-4fa2-08db5db87c46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92za71Jv3raFQ6ELngNAt5Ni1qhuCnjiQoIV+lKkNhL7FdoAt1S76wNWQA5wgne3DuyMqpS8XZraCqN5BH/TPLPbu9HwFsTfAYEs7RN4TvEP4yVSoMdFLL0/ndrl1ASDicS3W4nbvmBtT7Jhk7vkXcL+tyWpbYPjtCJcuGEfPGJi9nLVr3uPoxEeaw5DzTmgAWBx0XW9PxVmWDFs/ZUD3IWcyom4roQuvUXhrJine+D3HmqWkXapgyVjHer5s+Sg+A813sOXNyte+m7D82EndRpFwnCQAANRANzhMP53iYDCnHe9zDegh2K/s4MWJweuSRlCK2QZL5KaeqSybPy+LYdg6205COkReAbeaWPAhVkeDkMOCDwbiymgSk4WNV55pzvatEGFODSp9kJxrLv7ODAIaNtNpFFNibt6xsPjU5Xi57SgLOV8D663Aknm5ypSqmsI4vT+ROCoV5ONu5nfZ4z5ES485qF8mfbgZX52hzWRz9aDjmIBsSghiUg6DpNXQSqOJpURILtMKqN3ssXKVx4yRpdlPQh7STjsZiaOMaRNIcRsjMXmKwEL/xiluYp2kw6C0NffVQIaaiQP98rr2tlZ1kE7qU7+mW2jeUlBctFCnjIJHYzmSrHGPAFvMyFqJbRIjxqqldsqYMo2GkYD/iOFL6beWWfxRkNTP7j2sag= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(376002)(396003)(346002)(366004)(451199021)(31686004)(2906002)(54906003)(5660300002)(8936002)(8676002)(41300700001)(6916009)(478600001)(4326008)(66476007)(66556008)(316002)(36756003)(66946007)(6486002)(2616005)(6512007)(26005)(6506007)(31696002)(86362001)(38100700002)(53546011)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bXBJS2hBdTdHblgyNE9VL3BuVDlvUU5iZEhPMExsd1gvVTNIdXlaVTBka0dy?= =?utf-8?B?eVVQWE50Tzh2bUJPVnB2YURyamRmakkvajJCSzdtSHpoRXUybklzVkdUN0VF?= =?utf-8?B?M1k2K3ExbWZRbm9YU1g0NkwrWjYwQkJUdjRYSUZmbkZwc2tGVEQxUmVpM0NV?= =?utf-8?B?N3BweEFVN0lvTDBPdVlNTGNpMWJrSjVIdmpNdTFWOXdVSjRVOWRwU0MzUERw?= =?utf-8?B?dGlKQU9nOTMyelUzWVNVO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=?utf-8?B?aUpjQW1lUlloK1FyUDYzb0hUSGU3L1ZpM05pNVJDRkgzc09IYWFzMEtRaW50?= =?utf-8?Q?VCMSIYLMNZaA1i9YFVnavwEBc?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: cef1748f-b01c-4ef5-4fa2-08db5db87c46 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 07:11:54.5450 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cHnU6SJ+G2vC0aQQjmEnxWraiD6ISDpJXcQ8cEGtKJ09JplS4bgyNIQI5lXj/W4fGzJ7440Mwsy5Kv+4PqBfAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9742 X-Spam-Status: No, score=-3027.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On 25.05.2023 18:11, Fangrui Song wrote: > On 2023-05-25, Jan Beulich wrote: >> On 25.05.2023 17:16, Fangrui Song wrote: >>> --- a/gcc/doc/invoke.texi >>> +++ b/gcc/doc/invoke.texi >>> @@ -32942,9 +32942,10 @@ the cache line size. @samp{compat} is the default. >>> >>> @opindex mlarge-data-threshold >>> @item -mlarge-data-threshold=@var{threshold} >>> -When @option{-mcmodel=medium} is specified, data objects larger than >>> -@var{threshold} are placed in the large data section. This value must be the >>> -same across all objects linked into the binary, and defaults to 65535. >>> +When @option{-mcmodel=medium} or @option{-mcmodel=large} is specified, data >>> +objects larger than @var{threshold} are placed in large data sections. This >>> +value must be the same across all objects linked into the binary, and defaults >>> +to 65535. >> >> Where's the "must be the same" requirement coming from? > > It's an existing requirement. I think it may be related to discouraging > different COMDAT sections names due to different -mlarge-data-threshold=. > I don't think it makes sense but did not feel strongly dropping it. > > Happy to drop the requirement if I revise this patch. I understand that this isn't something you introduce, but it still stuck me as odd. Therefore I thought I'd suggest to take the opportunity to at least soften the language, unless of course there's a real reason behind it. >> As to the default - to remain compatible with earlier versions, shouldn't >> large model code default to "infinity"? >> >> Jan > > I have thought about this compatibility need and feel that it is very > unlikly to be needed. GNU ld has supported large data sections since > 2005 > (https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=3b22753a67cf616514de804ef6d5ed5e90a7d883). > Users' programs with the internal linker scripts will still be working > and -fdata-sections sections will be combined. Well, the concern clearly is about custom scripts. Imo ... > First, -mcmodel=large use cases are rare enough. Rare perhaps > -mcmodel=largel was considered theoretic excercise in > trying to reach feature completion > (https://groups.google.com/g/x86-64-abi/c/jnQdJeabxiU/m/NNuA0P7pAQAJ), > without this patch -mcmodel=large object files don't interract well with > existing -mcmodel=small object files. ... the more exotic a project, the more likely it is that they're using custom scripts. > Moreover, if a user expects a specific section prefix with > -mcmodel=large, that's a brittle assumption. I think it's fair to say > that the fault is on the user side and GCC doesn't need to work around > their issues. I guess I don't really see what you base this on. Without any special options, expecting data to end up in .data/.bss/.rodata (and variants thereof) looks like quite reasonable an assumption to me. Jan