public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] Objective-C, NeXT, v2: Correct a regression in code-gen.
@ 2024-05-02 12:53 Iain Sandoe
  2024-05-02 13:05 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2024-05-02 12:53 UTC (permalink / raw)
  To: gcc-patches, jakub

My testing of the GCC-14 release branch revealed an Objective-C
regression in code-gen, the fix has been tested on x86_64, i686
and powerpc darwin, pushed to trunk.

I will shortly apply this to the open branches, since they are
affected too.  Given that this is completely local to Darwin and
Objective-C (and pretty trivial too) - would it be acceptable for
GCC-14.1?

thanks
Iain

--- 8< ---

There have been several changes in the ABI of Objective-C which
depend on the OS version targetted.  In this case Protocols and
LabelProtocols should be made weak/hidden/extern from macOS 10.7
however there was a mistake in the code causing this to occur
from macOS 10.6.  Fixed thus.

gcc/objc/ChangeLog:

	* objc-next-runtime-abi-02.cc (WEAK_PROTOCOLS_AFTER): New.
	(next_runtime_abi_02_protocol_decl): Use WEAK_PROTOCOLS_AFTER
	to determine this ABI change.
	(build_v2_protocol_list_address_table): Likewise.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/objc/objc-next-runtime-abi-02.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc
index cdf559b9bea..248ef641281 100644
--- a/gcc/objc/objc-next-runtime-abi-02.cc
+++ b/gcc/objc/objc-next-runtime-abi-02.cc
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3.  If not see
 #define TAG_MSGSENDSUPER_STRET	"objc_msgSendSuper2_stret"
 
 #define USE_FIXUP_BEFORE	100600
+#define WEAK_PROTOCOLS_AFTER	100700
 #define TAG_FIXUP		"_fixup"
 
 
@@ -1025,7 +1026,7 @@ next_runtime_abi_02_protocol_decl (tree p)
   /* static struct _objc_protocol _OBJC_Protocol_<mumble>; */
   snprintf (buf, BUFSIZE, "_OBJC_Protocol_%s",
 	    IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
-  if (flag_next_runtime >= USE_FIXUP_BEFORE)
+  if (flag_next_runtime >= WEAK_PROTOCOLS_AFTER)
     {
       decl = create_hidden_decl (objc_v2_protocol_template, buf);
       DECL_WEAK (decl) = true;
@@ -2315,7 +2316,7 @@ build_v2_protocol_list_address_table (void)
       gcc_assert (ref->id && TREE_CODE (ref->id) == PROTOCOL_INTERFACE_TYPE);
       snprintf (buf, BUFSIZE, "_OBJC_LabelProtocol_%s",
 		IDENTIFIER_POINTER (PROTOCOL_NAME (ref->id)));
-      if (flag_next_runtime >= USE_FIXUP_BEFORE)
+      if (flag_next_runtime >= WEAK_PROTOCOLS_AFTER)
 	{
 	  decl = create_hidden_decl (objc_protocol_type, buf, /*is def=*/true);
 	  DECL_WEAK (decl) = true;
-- 
2.39.2 (Apple Git-143)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pushed] Objective-C, NeXT, v2: Correct a regression in code-gen.
  2024-05-02 12:53 [pushed] Objective-C, NeXT, v2: Correct a regression in code-gen Iain Sandoe
@ 2024-05-02 13:05 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2024-05-02 13:05 UTC (permalink / raw)
  To: iain; +Cc: gcc-patches

On Thu, May 02, 2024 at 01:53:21PM +0100, Iain Sandoe wrote:
> My testing of the GCC-14 release branch revealed an Objective-C
> regression in code-gen, the fix has been tested on x86_64, i686
> and powerpc darwin, pushed to trunk.
> 
> I will shortly apply this to the open branches, since they are
> affected too.  Given that this is completely local to Darwin and
> Objective-C (and pretty trivial too) - would it be acceptable for
> GCC-14.1?

Can't this just wait for GCC 14.2?
The code has been like that for years, no, and it is ObjC, not a release
critical language.

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-02 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 12:53 [pushed] Objective-C, NeXT, v2: Correct a regression in code-gen Iain Sandoe
2024-05-02 13:05 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).