This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PowerPC -mcmodel preprocessor define


Someone in IBM (Ulrich Weigand?) observed that some powerpc asm may
need changing for -mcmodel=medium, so it would be a good idea to
define builtin macros to allow selection of the correct asm.

Bootstrapped etc. powerpc64-linux.  OK for 4.6?  I know this isn't a
regression fix, but I'm hoping the rules can be bent enough for this
to go in.

	* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Add
	builtin_define __CMODEL_MEDIUM__ and __CMODEL_LARGE__.

Index: gcc/config/rs6000/rs6000-c.c
===================================================================
--- gcc/config/rs6000/rs6000-c.c	(revision 167467)
+++ gcc/config/rs6000/rs6000-c.c	(working copy)
@@ -385,6 +385,20 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfi
       builtin_define ("__LONGDOUBLE128");
     }
 
+  switch (TARGET_CMODEL)
+    {
+      /* Deliberately omit __CMODEL_SMALL__ since that was the default
+	 before -mcmodel support was added.  */
+    case CMODEL_MEDIUM:
+      builtin_define ("__CMODEL_MEDIUM__");
+      break;
+    case CMODEL_LARGE:
+      builtin_define ("__CMODEL_LARGE__");
+      break;
+    default:
+      break;
+    }
+
   switch (rs6000_current_abi)
     {
     case ABI_V4:

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]