diff mbox

PowerPC -mcmodel preprocessor define

Message ID 20110120124136.GE11694@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra Jan. 20, 2011, 12:41 p.m. UTC
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__.

Comments

David Edelsohn Jan. 20, 2011, 3:54 p.m. UTC | #1
On Thu, Jan 20, 2011 at 7:41 AM, Alan Modra <amodra@gmail.com> wrote:
> 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__.

Okay.

Thanks, David
diff mbox

Patch

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: