From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from pv34p98im-ztdg02172101.me.com (pv34p98im-ztdg02172101.me.com [17.143.234.142]) by sourceware.org (Postfix) with ESMTPS id A5DC73858C3A for ; Wed, 20 Oct 2021 03:51:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5DC73858C3A Received: from [10.0.1.20] (unknown [107.13.75.131]) by pv34p98im-ztdg02172101.me.com (Postfix) with ESMTPSA id C5ED85400DD for ; Wed, 20 Oct 2021 03:51:52 +0000 (UTC) From: Matt Jacobson Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] Objective-C: fix protocol list count type (pertinent to non-LP64) Date: Tue, 19 Oct 2021 23:51:49 -0400 References: <3FA161CB-9D8F-4576-8607-292CE21B2BF3@me.com> To: gcc-patches@gcc.gnu.org In-Reply-To: <3FA161CB-9D8F-4576-8607-292CE21B2BF3@me.com> Message-Id: X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.790 definitions=2021-10-20_01:2021-10-18, 2021-10-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2110200017 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2021 03:51:56 -0000 > On Sep 26, 2021, at 11:45 PM, Matt Jacobson wrote: >=20 > Fix protocol list layout for non-LP64. clang and objc4 both give the = `count`=20 > field as `long`, not `intptr_t`. Those are the same on LP64, but not=20= > everywhere. For non-LP64, this fixes binary compatibility with = clang-built=20 > classes. >=20 > This was more complicated than I anticipated, because the relevant = frontend=20 > code in fact had no AST type for `protocol_list_t`, instead emitting = protocol=20 > lists as `protocol_t[]`, with the zeroth element actually being the = integer=20 > count. That made it nontrivial to change the count to `long`. With = this=20 > change, there is now a true `protocol_list_t` type in the AST. >=20 > Tested multiple ways. On x86_64/Darwin, I confirmed with a test = program that=20 > protocol conformances by classes, categories, and protocols works. On = AVR, I=20 > manually inspected the generated assembly to confirm that protocol = lists gain=20 > an extra two bytes of `count`, matching clang. >=20 > Thank you for your time. >=20 > = Friendly ping. Please let me know if there=E2=80=99s anything I can = clarify. Original mail: Thanks.=