public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, Darwin, x86] fix 53283
@ 2012-06-25  8:02 Iain Sandoe
  2012-06-25  8:54 ` Mike Stump
  0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2012-06-25  8:02 UTC (permalink / raw)
  To: GCC Patches; +Cc: Mike Stump

As described in the PR thread, Darwin was already using the TARGET_FOLD_BUILTIN hook to process CFstrings.

The patch fixes the breakage by calling a SUBTARGET_FOLD_BUILTIN where defined (following similar patterns for other items that require sub-target handling).

OK for trunk?
Iain

gcc:

	PR target/53283
	* config/i386/i386.c (ix86_fold_builtin): Call SUBTARGET_FOLD_BUILTIN
	if defined.
	* config/darwin.h: Rename TARGET_FOLD_BUILTIN to
	SUBTARGET_FOLD_BUILTIN.
	* config/rs6000/darwin.h: Map TARGET_FOLD_BUILTIN onto
	SUBTARGET_FOLD_BUILTIN.

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 188918)
+++ gcc/config/i386/i386.c	(working copy)
@@ -28030,6 +28030,10 @@ ix86_fold_builtin (tree fndecl, int n_args,
 	}
     }
 
+#ifdef SUBTARGET_FOLD_BUILTIN
+  return SUBTARGET_FOLD_BUILTIN (fndecl, n_args, args, ignore);
+#endif
+
   return NULL_TREE;
 }
 
Index: gcc/config/rs6000/darwin.h
===================================================================
--- gcc/config/rs6000/darwin.h	(revision 188918)
+++ gcc/config/rs6000/darwin.h	(working copy)
@@ -422,3 +422,7 @@ do {									\
   rs6000_builtin_decls[(unsigned) (RS6000_BUILTIN_CFSTRING)]		\
     = darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_CFSTRING)); \
 } while(0)
+
+/* So far, there is no rs6000_fold_builtin, if one is introduced, then
+   this will need to be modified similar to the x86 case.  */
+#define TARGET_FOLD_BUILTIN SUBTARGET_FOLD_BUILTIN
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 188918)
+++ gcc/config/darwin.h	(working copy)
@@ -912,7 +909,7 @@ void add_framework_path (char *);
 #define TARGET_KEXTABI flag_apple_kext
 
 /* We have target-specific builtins.  */
-#define TARGET_FOLD_BUILTIN darwin_fold_builtin
+#define SUBTARGET_FOLD_BUILTIN darwin_fold_builtin
 
 #define TARGET_N_FORMAT_TYPES 1
 #define TARGET_FORMAT_TYPES darwin_additional_format_types

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

* Re: [Patch, Darwin, x86] fix 53283
  2012-06-25  8:02 [Patch, Darwin, x86] fix 53283 Iain Sandoe
@ 2012-06-25  8:54 ` Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2012-06-25  8:54 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: GCC Patches

On Jun 25, 2012, at 12:53 AM, Iain Sandoe wrote:
> As described in the PR thread, Darwin was already using the TARGET_FOLD_BUILTIN hook to process CFstrings.
> 
> The patch fixes the breakage by calling a SUBTARGET_FOLD_BUILTIN where defined (following similar patterns for other items that require sub-target handling).
> 
> OK for trunk?

Ok.

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

end of thread, other threads:[~2012-06-25  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25  8:02 [Patch, Darwin, x86] fix 53283 Iain Sandoe
2012-06-25  8:54 ` Mike Stump

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).