From 7f9f095e3a2dd46a8067fc3513a35c635efac939 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 21 Jan 2011 12:43:52 +1030 Subject: [PATCH] rs6000-c.c (rs6000_cpu_cpp_builtins): Add builtin_define __CMODEL_MEDIUM__ and __CMODEL_LARGE__. * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Add builtin_define __CMODEL_MEDIUM__ and __CMODEL_LARGE__. From-SVN: r169077 --- gcc/ChangeLog | 5 +++++ gcc/config/rs6000/rs6000-c.c | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc28b24..de7d1b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-01-21 Alan Modra + + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Add + builtin_define __CMODEL_MEDIUM__ and __CMODEL_LARGE__. + 2011-01-20 Ramana Radhakrishnan * config/arm/arm.md (define_attr type): Rename f_load diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index b2e0d60..f29373d 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -1,5 +1,5 @@ /* Subroutines for the C front end on the POWER and PowerPC architectures. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Zack Weinberg @@ -385,6 +385,20 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) 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: -- 2.7.4